static void set_rx_filter_handler(struct work_struct *work) { struct zd_mac *mac = container_of(work, struct zd_mac, set_rx_filter_work); int r; dev_dbg_f(zd_mac_dev(mac), "\n"); r = set_rx_filter(mac); if (r) dev_err(zd_mac_dev(mac), "set_rx_filter_handler error %d\n", r); }
int can_set_filter(struct can_id id, unsigned int mask) { int ret; set_mode(REQOP_CONFIG); ret = set_rx_filter(id, mask); set_mode(REQOP_NORMAL); return ret; }
static int zd_op_start(struct ieee80211_hw *hw) { struct zd_mac *mac = zd_hw_mac(hw); struct zd_chip *chip = &mac->chip; struct zd_usb *usb = &chip->usb; int r; if (!usb->initialized) { r = zd_usb_init_hw(usb); if (r) goto out; } r = zd_chip_enable_int(chip); if (r < 0) goto out; r = zd_chip_set_basic_rates(chip, CR_RATES_80211B | CR_RATES_80211G); if (r < 0) goto disable_int; r = set_rx_filter(mac); if (r) goto disable_int; r = set_mc_hash(mac); if (r) goto disable_int; r = zd_chip_switch_radio_on(chip); if (r < 0) goto disable_int; r = zd_chip_enable_rxtx(chip); if (r < 0) goto disable_radio; r = zd_chip_enable_hwint(chip); if (r < 0) goto disable_rxtx; housekeeping_enable(mac); return 0; disable_rxtx: zd_chip_disable_rxtx(chip); disable_radio: zd_chip_switch_radio_off(chip); disable_int: zd_chip_disable_int(chip); out: return r; }
int can_rx_set_filter(struct can_id id, unsigned int mask) { int ret; set_mode(REQOP_CONFIG); ret = set_rx_filter(id, mask); set_rx_mode(0, RXM_BOTH); /* TODO: Check if rollover is on */ set_rx_mode(1, RXM_BOTH); set_mode(REQOP_NORMAL); return ret; }