• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/wireless/

Lines Matching refs:hw

102 	/* hw receives here */
117 /* hw transmits here */
130 struct ieee80211_hw *hw;
576 static int mwl8k_load_firmware(struct ieee80211_hw *hw)
578 struct mwl8k_priv *priv = hw->priv;
897 static int mwl8k_rxq_init(struct ieee80211_hw *hw, int index)
899 struct mwl8k_priv *priv = hw->priv;
912 wiphy_err(hw->wiphy, "failed to alloc RX descriptors\n");
919 wiphy_err(hw->wiphy, "failed to alloc RX skbuff list\n");
945 static int rxq_refill(struct ieee80211_hw *hw, int index, int limit)
947 struct mwl8k_priv *priv = hw->priv;
982 static void mwl8k_rxq_deinit(struct ieee80211_hw *hw, int index)
984 struct mwl8k_priv *priv = hw->priv;
1022 static inline void mwl8k_save_beacon(struct ieee80211_hw *hw,
1025 struct mwl8k_priv *priv = hw->priv;
1037 ieee80211_queue_work(hw, &priv->finalize_join_worker);
1040 static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
1042 struct mwl8k_priv *priv = hw->priv;
1087 mwl8k_save_beacon(hw, skb);
1090 ieee80211_rx_irqsafe(hw, skb);
1132 static int mwl8k_txq_init(struct ieee80211_hw *hw, int index)
1134 struct mwl8k_priv *priv = hw->priv;
1147 wiphy_err(hw->wiphy, "failed to alloc TX descriptors\n");
1154 wiphy_err(hw->wiphy, "failed to alloc TX skbuff list\n");
1184 static void mwl8k_dump_tx_rings(struct ieee80211_hw *hw)
1186 struct mwl8k_priv *priv = hw->priv;
1210 wiphy_err(hw->wiphy,
1224 static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw)
1226 struct mwl8k_priv *priv = hw->priv;
1259 wiphy_notice(hw->wiphy, "tx rings drained\n");
1265 wiphy_notice(hw->wiphy,
1274 wiphy_err(hw->wiphy, "tx rings stuck for %d ms\n",
1276 mwl8k_dump_tx_rings(hw);
1291 mwl8k_txq_reclaim(struct ieee80211_hw *hw, int index, int limit, int force)
1293 struct mwl8k_priv *priv = hw->priv;
1343 ieee80211_tx_status_irqsafe(hw, skb);
1349 ieee80211_wake_queue(hw, index);
1355 static void mwl8k_txq_deinit(struct ieee80211_hw *hw, int index)
1357 struct mwl8k_priv *priv = hw->priv;
1360 mwl8k_txq_reclaim(hw, index, INT_MAX, 1);
1372 mwl8k_txq_xmit(struct ieee80211_hw *hw, int index, struct sk_buff *skb)
1374 struct mwl8k_priv *priv = hw->priv;
1426 wiphy_debug(hw->wiphy,
1461 ieee80211_stop_queue(hw, index);
1487 static int mwl8k_fw_lock(struct ieee80211_hw *hw)
1489 struct mwl8k_priv *priv = hw->priv;
1495 ieee80211_stop_queues(hw);
1497 rc = mwl8k_tx_wait_empty(hw);
1499 ieee80211_wake_queues(hw);
1513 static void mwl8k_fw_unlock(struct ieee80211_hw *hw)
1515 struct mwl8k_priv *priv = hw->priv;
1518 ieee80211_wake_queues(hw);
1532 static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1535 struct mwl8k_priv *priv = hw->priv;
1550 rc = mwl8k_fw_lock(hw);
1569 mwl8k_fw_unlock(hw);
1575 wiphy_err(hw->wiphy, "Command %s timeout after %u ms\n",
1586 wiphy_err(hw->wiphy, "Command %s error 0x%x\n",
1590 wiphy_notice(hw->wiphy, "Command %s took %d ms\n",
1599 static int mwl8k_post_pervif_cmd(struct ieee80211_hw *hw,
1605 return mwl8k_post_cmd(hw, cmd);
1611 static void mwl8k_setup_2ghz_band(struct ieee80211_hw *hw)
1613 struct mwl8k_priv *priv = hw->priv;
1627 hw->wiphy->bands[IEEE80211_BAND_2GHZ] = &priv->band_24;
1630 static void mwl8k_setup_5ghz_band(struct ieee80211_hw *hw)
1632 struct mwl8k_priv *priv = hw->priv;
1646 hw->wiphy->bands[IEEE80211_BAND_5GHZ] = &priv->band_50;
1688 mwl8k_set_ht_caps(struct ieee80211_hw *hw,
1701 hw->flags |= IEEE80211_HW_AMPDU_AGGREGATION;
1737 mwl8k_set_caps(struct ieee80211_hw *hw, u32 caps)
1739 struct mwl8k_priv *priv = hw->priv;
1742 mwl8k_setup_2ghz_band(hw);
1744 mwl8k_set_ht_caps(hw, &priv->band_24, caps);
1748 mwl8k_setup_5ghz_band(hw);
1750 mwl8k_set_ht_caps(hw, &priv->band_50, caps);
1754 static int mwl8k_cmd_get_hw_spec_sta(struct ieee80211_hw *hw)
1756 struct mwl8k_priv *priv = hw->priv;
1777 rc = mwl8k_post_cmd(hw, &cmd->header);
1780 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr);
1784 mwl8k_set_caps(hw, le32_to_cpu(cmd->caps));
1815 static int mwl8k_cmd_get_hw_spec_ap(struct ieee80211_hw *hw)
1817 struct mwl8k_priv *priv = hw->priv;
1831 rc = mwl8k_post_cmd(hw, &cmd->header);
1836 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr);
1840 mwl8k_setup_2ghz_band(hw);
1892 static int mwl8k_cmd_set_hw_spec(struct ieee80211_hw *hw)
1894 struct mwl8k_priv *priv = hw->priv;
1917 rc = mwl8k_post_cmd(hw, &cmd->header);
1939 __mwl8k_cmd_mac_multicast_adr(struct ieee80211_hw *hw, int allmulti,
1942 struct mwl8k_priv *priv = hw->priv;
1995 static int mwl8k_cmd_get_stat(struct ieee80211_hw *hw,
2008 rc = mwl8k_post_cmd(hw, &cmd->header);
2035 mwl8k_cmd_radio_control(struct ieee80211_hw *hw, bool enable, bool force)
2037 struct mwl8k_priv *priv = hw->priv;
2054 rc = mwl8k_post_cmd(hw, &cmd->header);
2063 static int mwl8k_cmd_radio_disable(struct ieee80211_hw *hw)
2065 return mwl8k_cmd_radio_control(hw, 0, 0);
2068 static int mwl8k_cmd_radio_enable(struct ieee80211_hw *hw)
2070 return mwl8k_cmd_radio_control(hw, 1, 0);
2074 mwl8k_set_radio_preamble(struct ieee80211_hw *hw, bool short_preamble)
2076 struct mwl8k_priv *priv = hw->priv;
2080 return mwl8k_cmd_radio_control(hw, 1, 1);
2097 static int mwl8k_cmd_rf_tx_power(struct ieee80211_hw *hw, int dBm)
2111 rc = mwl8k_post_cmd(hw, &cmd->header);
2130 mwl8k_cmd_rf_antenna(struct ieee80211_hw *hw, int antenna, int mask)
2144 rc = mwl8k_post_cmd(hw, &cmd->header);
2159 static int mwl8k_cmd_set_beacon(struct ieee80211_hw *hw,
2174 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
2187 static int mwl8k_cmd_set_pre_scan(struct ieee80211_hw *hw)
2199 rc = mwl8k_post_cmd(hw, &cmd->header);
2215 mwl8k_cmd_set_post_scan(struct ieee80211_hw *hw, const __u8 *mac)
2229 rc = mwl8k_post_cmd(hw, &cmd->header);
2245 static int mwl8k_cmd_set_rf_channel(struct ieee80211_hw *hw,
2274 rc = mwl8k_post_cmd(hw, &cmd->header);
2315 mwl8k_cmd_set_aid(struct ieee80211_hw *hw,
2351 rc = mwl8k_post_cmd(hw, &cmd->header);
2370 mwl8k_cmd_set_rate(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2385 rc = mwl8k_post_cmd(hw, &cmd->header);
2402 static int mwl8k_cmd_finalize_join(struct ieee80211_hw *hw, void *frame,
2426 rc = mwl8k_post_cmd(hw, &cmd->header);
2442 mwl8k_cmd_set_rts_threshold(struct ieee80211_hw *hw, int rts_thresh)
2456 rc = mwl8k_post_cmd(hw, &cmd->header);
2471 static int mwl8k_cmd_set_slot(struct ieee80211_hw *hw, bool short_slot_time)
2485 rc = mwl8k_post_cmd(hw, &cmd->header);
2542 mwl8k_cmd_set_edca_params(struct ieee80211_hw *hw, __u8 qnum,
2546 struct mwl8k_priv *priv = hw->priv;
2570 rc = mwl8k_post_cmd(hw, &cmd->header);
2584 static int mwl8k_cmd_set_wmm_mode(struct ieee80211_hw *hw, bool enable)
2586 struct mwl8k_priv *priv = hw->priv;
2598 rc = mwl8k_post_cmd(hw, &cmd->header);
2617 static int mwl8k_cmd_mimo_config(struct ieee80211_hw *hw, __u8 rx, __u8 tx)
2632 rc = mwl8k_post_cmd(hw, &cmd->header);
2660 static int mwl8k_cmd_use_fixed_rate_sta(struct ieee80211_hw *hw)
2674 rc = mwl8k_post_cmd(hw, &cmd->header);
2700 mwl8k_cmd_use_fixed_rate_ap(struct ieee80211_hw *hw, int mcast, int mgmt)
2715 rc = mwl8k_post_cmd(hw, &cmd->header);
2729 static int mwl8k_cmd_enable_sniffer(struct ieee80211_hw *hw, bool enable)
2742 rc = mwl8k_post_cmd(hw, &cmd->header);
2767 static int mwl8k_cmd_set_mac_addr(struct ieee80211_hw *hw,
2770 struct mwl8k_priv *priv = hw->priv;
2802 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
2817 static int mwl8k_cmd_set_rateadapt_mode(struct ieee80211_hw *hw, __u16 mode)
2831 rc = mwl8k_post_cmd(hw, &cmd->header);
2845 static int mwl8k_cmd_bss_start(struct ieee80211_hw *hw,
2859 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
2893 static int mwl8k_cmd_set_new_stn_add(struct ieee80211_hw *hw,
2911 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
2927 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
2933 static int mwl8k_cmd_set_new_stn_add_self(struct ieee80211_hw *hw,
2947 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
2953 static int mwl8k_cmd_set_new_stn_del(struct ieee80211_hw *hw,
2968 rc = mwl8k_post_pervif_cmd(hw, vif, &cmd->header);
3033 static int mwl8k_cmd_update_stadb_add(struct ieee80211_hw *hw,
3058 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
3067 rc = mwl8k_post_cmd(hw, &cmd->header);
3073 static int mwl8k_cmd_update_stadb_del(struct ieee80211_hw *hw,
3088 rc = mwl8k_post_cmd(hw, &cmd->header);
3100 struct ieee80211_hw *hw = dev_id;
3101 struct mwl8k_priv *priv = hw->priv;
3137 struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
3138 struct mwl8k_priv *priv = hw->priv;
3147 limit -= mwl8k_txq_reclaim(hw, i, limit, 0);
3166 struct ieee80211_hw *hw = (struct ieee80211_hw *)data;
3167 struct mwl8k_priv *priv = hw->priv;
3171 limit -= rxq_process(hw, 0, limit);
3172 limit -= rxq_refill(hw, 0, limit);
3186 static int mwl8k_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
3188 struct mwl8k_priv *priv = hw->priv;
3193 wiphy_debug(hw->wiphy,
3199 rc = mwl8k_txq_xmit(hw, index, skb);
3204 static int mwl8k_start(struct ieee80211_hw *hw)
3206 struct mwl8k_priv *priv = hw->priv;
3210 IRQF_SHARED, MWL8K_NAME, hw);
3212 wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
3223 rc = mwl8k_fw_lock(hw);
3225 rc = mwl8k_cmd_radio_enable(hw);
3229 rc = mwl8k_cmd_enable_sniffer(hw, 0);
3232 rc = mwl8k_cmd_set_pre_scan(hw);
3235 rc = mwl8k_cmd_set_post_scan(hw,
3240 rc = mwl8k_cmd_set_rateadapt_mode(hw, 0);
3243 rc = mwl8k_cmd_set_wmm_mode(hw, 0);
3245 mwl8k_fw_unlock(hw);
3250 free_irq(priv->pdev->irq, hw);
3258 static void mwl8k_stop(struct ieee80211_hw *hw)
3260 struct mwl8k_priv *priv = hw->priv;
3263 mwl8k_cmd_radio_disable(hw);
3265 ieee80211_stop_queues(hw);
3269 free_irq(priv->pdev->irq, hw);
3282 mwl8k_txq_reclaim(hw, i, INT_MAX, 1);
3285 static int mwl8k_add_interface(struct ieee80211_hw *hw,
3288 struct mwl8k_priv *priv = hw->priv;
3299 wiphy_info(hw->wiphy,
3328 mwl8k_cmd_set_mac_addr(hw, vif, vif->addr);
3331 mwl8k_cmd_set_new_stn_add_self(hw, vif);
3339 static void mwl8k_remove_interface(struct ieee80211_hw *hw,
3342 struct mwl8k_priv *priv = hw->priv;
3346 mwl8k_cmd_set_new_stn_del(hw, vif, vif->addr);
3348 mwl8k_cmd_set_mac_addr(hw, vif, "\x00\x00\x00\x00\x00\x00");
3354 static int mwl8k_config(struct ieee80211_hw *hw, u32 changed)
3356 struct ieee80211_conf *conf = &hw->conf;
3357 struct mwl8k_priv *priv = hw->priv;
3361 mwl8k_cmd_radio_disable(hw);
3365 rc = mwl8k_fw_lock(hw);
3369 rc = mwl8k_cmd_radio_enable(hw);
3373 rc = mwl8k_cmd_set_rf_channel(hw, conf);
3379 rc = mwl8k_cmd_rf_tx_power(hw, conf->power_level);
3384 rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_RX, 0x7);
3386 rc = mwl8k_cmd_rf_antenna(hw, MWL8K_RF_ANTENNA_TX, 0x7);
3388 rc = mwl8k_cmd_mimo_config(hw, 0x7, 0x7);
3392 mwl8k_fw_unlock(hw);
3398 mwl8k_bss_info_changed_sta(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3401 struct mwl8k_priv *priv = hw->priv;
3406 if (mwl8k_fw_lock(hw))
3429 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ) {
3441 rc = mwl8k_cmd_set_rate(hw, vif, ap_legacy_rates, ap_mcs_rates);
3445 rc = mwl8k_cmd_use_fixed_rate_sta(hw);
3451 rc = mwl8k_set_radio_preamble(hw,
3458 rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot);
3466 rc = mwl8k_cmd_set_aid(hw, vif, ap_legacy_rates);
3482 mwl8k_fw_unlock(hw);
3486 mwl8k_bss_info_changed_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3491 if (mwl8k_fw_lock(hw))
3495 rc = mwl8k_set_radio_preamble(hw,
3514 if (hw->conf.channel->band == IEEE80211_BAND_2GHZ)
3519 mwl8k_cmd_use_fixed_rate_ap(hw, rate, rate);
3525 skb = ieee80211_beacon_get(hw, vif);
3527 mwl8k_cmd_set_beacon(hw, vif, skb->data, skb->len);
3533 mwl8k_cmd_bss_start(hw, vif, info->enable_beacon);
3536 mwl8k_fw_unlock(hw);
3540 mwl8k_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3543 struct mwl8k_priv *priv = hw->priv;
3546 mwl8k_bss_info_changed_sta(hw, vif, info, changed);
3548 mwl8k_bss_info_changed_ap(hw, vif, info, changed);
3551 static u64 mwl8k_prepare_multicast(struct ieee80211_hw *hw,
3563 cmd = __mwl8k_cmd_mac_multicast_adr(hw, 0, mc_list);
3569 mwl8k_configure_filter_sniffer(struct ieee80211_hw *hw,
3573 struct mwl8k_priv *priv = hw->priv;
3582 wiphy_info(hw->wiphy,
3588 if (mwl8k_cmd_enable_sniffer(hw, 1))
3608 static void mwl8k_configure_filter(struct ieee80211_hw *hw,
3613 struct mwl8k_priv *priv = hw->priv;
3631 mwl8k_configure_filter_sniffer(hw, changed_flags, total_flags)) {
3639 if (mwl8k_fw_lock(hw)) {
3645 mwl8k_cmd_enable_sniffer(hw, 0);
3654 mwl8k_cmd_set_pre_scan(hw);
3673 mwl8k_cmd_set_post_scan(hw, bssid);
3685 cmd = __mwl8k_cmd_mac_multicast_adr(hw, 1, NULL);
3689 mwl8k_post_cmd(hw, cmd);
3693 mwl8k_fw_unlock(hw);
3696 static int mwl8k_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
3698 return mwl8k_cmd_set_rts_threshold(hw, value);
3701 static int mwl8k_sta_remove(struct ieee80211_hw *hw,
3705 struct mwl8k_priv *priv = hw->priv;
3708 return mwl8k_cmd_set_new_stn_del(hw, vif, sta->addr);
3710 return mwl8k_cmd_update_stadb_del(hw, vif, sta->addr);
3713 static int mwl8k_sta_add(struct ieee80211_hw *hw,
3717 struct mwl8k_priv *priv = hw->priv;
3721 ret = mwl8k_cmd_update_stadb_add(hw, vif, sta);
3730 return mwl8k_cmd_set_new_stn_add(hw, vif, sta);
3733 static int mwl8k_conf_tx(struct ieee80211_hw *hw, u16 queue,
3736 struct mwl8k_priv *priv = hw->priv;
3739 rc = mwl8k_fw_lock(hw);
3742 rc = mwl8k_cmd_set_wmm_mode(hw, 1);
3745 rc = mwl8k_cmd_set_edca_params(hw, queue,
3751 mwl8k_fw_unlock(hw);
3757 static int mwl8k_get_stats(struct ieee80211_hw *hw,
3760 return mwl8k_cmd_get_stat(hw, stats);
3763 static int mwl8k_get_survey(struct ieee80211_hw *hw, int idx,
3766 struct mwl8k_priv *priv = hw->priv;
3767 struct ieee80211_conf *conf = &hw->conf;
3780 mwl8k_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
3787 if (!(hw->flags & IEEE80211_HW_AMPDU_AGGREGATION))
3828 mwl8k_cmd_finalize_join(priv->hw, skb->data, skb->len, dtim_period);
3882 struct ieee80211_hw *hw;
3910 hw = ieee80211_alloc_hw(sizeof(*priv), &mwl8k_ops);
3911 if (hw == NULL) {
3917 SET_IEEE80211_DEV(hw, &pdev->dev);
3918 pci_set_drvdata(pdev, hw);
3920 priv = hw->priv;
3921 priv->hw = hw;
3928 wiphy_err(hw->wiphy, "Cannot map device SRAM\n");
3940 wiphy_err(hw->wiphy, "Cannot map device registers\n");
3952 wiphy_err(hw->wiphy, "Firmware files not found\n");
3957 rc = mwl8k_load_firmware(hw);
3959 wiphy_err(hw->wiphy, "Cannot start firmware\n");
3970 wiphy_err(hw->wiphy,
3987 hw->extra_tx_headroom =
3990 hw->channel_change_time = 10;
3992 hw->queues = MWL8K_TX_QUEUES;
3995 hw->flags |= IEEE80211_HW_SIGNAL_DBM;
3996 hw->vif_data_size = sizeof(struct mwl8k_vif);
3997 hw->sta_data_size = sizeof(struct mwl8k_sta);
4010 tasklet_init(&priv->poll_tx_task, mwl8k_tx_poll, (unsigned long)hw);
4012 tasklet_init(&priv->poll_rx_task, mwl8k_rx_poll, (unsigned long)hw);
4020 rc = mwl8k_rxq_init(hw, 0);
4023 rxq_refill(hw, 0, INT_MAX);
4035 rc = mwl8k_txq_init(hw, i);
4047 IRQF_SHARED, MWL8K_NAME, hw);
4049 wiphy_err(hw->wiphy, "failed to register IRQ handler\n");
4062 rc = mwl8k_cmd_get_hw_spec_ap(hw);
4064 rc = mwl8k_cmd_set_hw_spec(hw);
4066 rc = mwl8k_cmd_get_hw_spec_sta(hw);
4069 wiphy_err(hw->wiphy, "Cannot initialise firmware\n");
4073 hw->wiphy->interface_modes = 0;
4075 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_AP);
4077 hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_STATION);
4081 rc = mwl8k_cmd_radio_disable(hw);
4083 wiphy_err(hw->wiphy, "Cannot disable\n");
4088 rc = mwl8k_cmd_set_mac_addr(hw, NULL, "\x00\x00\x00\x00\x00\x00");
4090 wiphy_err(hw->wiphy, "Cannot clear MAC address\n");
4096 free_irq(priv->pdev->irq, hw);
4098 rc = ieee80211_register_hw(hw);
4100 wiphy_err(hw->wiphy, "Cannot register device\n");
4104 wiphy_info(hw->wiphy, "%s v%d, %pm, %s firmware %u.%u.%u.%u\n",
4106 priv->hw_rev, hw->wiphy->perm_addr,
4115 free_irq(priv->pdev->irq, hw);
4119 mwl8k_txq_deinit(hw, i);
4120 mwl8k_rxq_deinit(hw, 0);
4139 ieee80211_free_hw(hw);
4157 struct ieee80211_hw *hw = pci_get_drvdata(pdev);
4161 if (hw == NULL)
4163 priv = hw->priv;
4165 ieee80211_stop_queues(hw);
4167 ieee80211_unregister_hw(hw);
4178 mwl8k_txq_reclaim(hw, i, INT_MAX, 1);
4181 mwl8k_txq_deinit(hw, i);
4183 mwl8k_rxq_deinit(hw, 0);
4190 ieee80211_free_hw(hw);