Lines Matching refs:r
180 int r; in zd_mac_preinit_hw() local
184 r = zd_chip_read_mac_addr_fw(&mac->chip, addr); in zd_mac_preinit_hw()
185 if (r) in zd_mac_preinit_hw()
186 return r; in zd_mac_preinit_hw()
195 int r; in zd_mac_init_hw() local
201 r = zd_chip_enable_int(chip); in zd_mac_init_hw()
202 if (r) in zd_mac_init_hw()
204 r = zd_chip_init_hw(chip); in zd_mac_init_hw()
205 if (r) in zd_mac_init_hw()
210 r = zd_read_regdomain(chip, &default_regdomain); in zd_mac_init_hw()
211 if (r) in zd_mac_init_hw()
219 r = zd_set_encryption_type(chip, ENC_SNIFFER); in zd_mac_init_hw()
220 if (r) in zd_mac_init_hw()
223 r = zd_reg2alpha2(mac->regdomain, alpha2); in zd_mac_init_hw()
224 if (r) in zd_mac_init_hw()
227 r = regulatory_hint(hw->wiphy, alpha2); in zd_mac_init_hw()
231 return r; in zd_mac_init_hw()
257 int r; in set_mac_and_bssid() local
262 r = zd_write_mac_addr(&mac->chip, mac->vif->addr); in set_mac_and_bssid()
263 if (r) in set_mac_and_bssid()
264 return r; in set_mac_and_bssid()
287 int r; in zd_op_start() local
290 r = zd_usb_init_hw(usb); in zd_op_start()
291 if (r) in zd_op_start()
295 r = zd_chip_enable_int(chip); in zd_op_start()
296 if (r < 0) in zd_op_start()
299 r = zd_chip_set_basic_rates(chip, CR_RATES_80211B | CR_RATES_80211G); in zd_op_start()
300 if (r < 0) in zd_op_start()
302 r = set_rx_filter(mac); in zd_op_start()
303 if (r) in zd_op_start()
305 r = set_mc_hash(mac); in zd_op_start()
306 if (r) in zd_op_start()
315 r = zd_chip_switch_radio_on(chip); in zd_op_start()
316 if (r < 0) { in zd_op_start()
321 r = zd_chip_enable_rxtx(chip); in zd_op_start()
322 if (r < 0) in zd_op_start()
324 r = zd_chip_enable_hwint(chip); in zd_op_start()
325 if (r < 0) in zd_op_start()
339 return r; in zd_op_start()
375 int r, beacon_interval, beacon_period; in zd_restore_settings() local
388 r = set_mac_and_bssid(mac); in zd_restore_settings()
389 if (r < 0) { in zd_restore_settings()
390 dev_dbg_f(zd_mac_dev(mac), "set_mac_and_bssid failed, %d\n", r); in zd_restore_settings()
391 return r; in zd_restore_settings()
394 r = zd_chip_set_channel(&mac->chip, channel); in zd_restore_settings()
395 if (r < 0) { in zd_restore_settings()
397 r); in zd_restore_settings()
398 return r; in zd_restore_settings()
403 r = zd_chip_set_multicast_hash(&mac->chip, &multicast_hash); in zd_restore_settings()
404 if (r < 0) { in zd_restore_settings()
406 "zd_chip_set_multicast_hash failed, %d\n", r); in zd_restore_settings()
407 return r; in zd_restore_settings()
719 int r, ret, num_cmds, req_pos = 0; in zd_mac_config_beacon() local
730 r = 0; in zd_mac_config_beacon()
738 r = -ENOMEM; in zd_mac_config_beacon()
742 r = zd_iowrite32_locked(&mac->chip, 0, CR_BCN_FIFO_SEMAPHORE); in zd_mac_config_beacon()
743 if (r < 0) in zd_mac_config_beacon()
745 r = zd_ioread32_locked(&mac->chip, &tmp, CR_BCN_FIFO_SEMAPHORE); in zd_mac_config_beacon()
746 if (r < 0) in zd_mac_config_beacon()
749 r = -EBUSY; in zd_mac_config_beacon()
756 r = zd_ioread32_locked(&mac->chip, &tmp, CR_BCN_FIFO_SEMAPHORE); in zd_mac_config_beacon()
757 if (r < 0) in zd_mac_config_beacon()
766 r = -ETIMEDOUT; in zd_mac_config_beacon()
796 r = zd_iowrite32a_locked(&mac->chip, ioreqs, num_cmds); in zd_mac_config_beacon()
818 if (r < 0 || ret < 0) { in zd_mac_config_beacon()
819 if (r >= 0) in zd_mac_config_beacon()
820 r = ret; in zd_mac_config_beacon()
838 r = zd_iowrite32_locked(&mac->chip, 0x00000400 | (full_len << 19), in zd_mac_config_beacon()
846 return r; in zd_mac_config_beacon()
860 return r; in zd_mac_config_beacon()
866 int r; in fill_ctrlset() local
917 r = zd_calc_tx_length_us(&cs->service, ZD_RATE(cs->modulation), in fill_ctrlset()
919 if (r < 0) in fill_ctrlset()
920 return r; in fill_ctrlset()
921 cs->current_length = cpu_to_le16(r); in fill_ctrlset()
944 int r; in zd_op_tx() local
946 r = fill_ctrlset(mac, skb); in zd_op_tx()
947 if (r) in zd_op_tx()
952 r = zd_usb_tx(&mac->chip.usb, skb); in zd_op_tx()
953 if (r) in zd_op_tx()
1246 int r; in zd_op_configure_filter() local
1271 r = set_rx_filter(mac); in zd_op_configure_filter()
1272 if (r) in zd_op_configure_filter()
1273 dev_err(zd_mac_dev(mac), "set_rx_filter error %d\n", r); in zd_op_configure_filter()
1514 int r; in link_led_handler() local
1523 r = zd_chip_control_leds(chip, in link_led_handler()
1525 if (r) in link_led_handler()
1526 dev_dbg_f(zd_mac_dev(mac), "zd_chip_control_leds error %d\n", r); in link_led_handler()