diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-11-10 12:56:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:26:47 -0500 |
commit | 708068db4c09f93937a6a83ac8fff8516f482b0f (patch) | |
tree | ad304f921b1ed43063bdc3d3d3416f49cd8b5a01 /drivers/net/wireless | |
parent | e39fdee1d7856817619326fa114438c146d74510 (diff) |
iwlwifi: legacy tx_cmd_protection function
Legacy (4965 and 3945) devices has different tx_cmd_protection routine.
Move to iwl-legacy.c
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-legacy.c | 34 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-legacy.h | 3 |
6 files changed, 40 insertions, 39 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index 1ab171949021..ebac04b7887c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2749,7 +2749,7 @@ static const struct iwl_legacy_ops iwl3945_legacy_ops = { | |||
2749 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { | 2749 | static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { |
2750 | .get_hcmd_size = iwl3945_get_hcmd_size, | 2750 | .get_hcmd_size = iwl3945_get_hcmd_size, |
2751 | .build_addsta_hcmd = iwl3945_build_addsta_hcmd, | 2751 | .build_addsta_hcmd = iwl3945_build_addsta_hcmd, |
2752 | .tx_cmd_protection = iwlcore_tx_cmd_protection, | 2752 | .tx_cmd_protection = iwl_legacy_tx_cmd_protection, |
2753 | .request_scan = iwl3945_request_scan, | 2753 | .request_scan = iwl3945_request_scan, |
2754 | .post_scan = iwl3945_post_scan, | 2754 | .post_scan = iwl3945_post_scan, |
2755 | }; | 2755 | }; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index a6518caa405c..cd14843878ae 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2514,7 +2514,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = { | |||
2514 | .build_addsta_hcmd = iwl4965_build_addsta_hcmd, | 2514 | .build_addsta_hcmd = iwl4965_build_addsta_hcmd, |
2515 | .chain_noise_reset = iwl4965_chain_noise_reset, | 2515 | .chain_noise_reset = iwl4965_chain_noise_reset, |
2516 | .gain_computation = iwl4965_gain_computation, | 2516 | .gain_computation = iwl4965_gain_computation, |
2517 | .tx_cmd_protection = iwlcore_tx_cmd_protection, | 2517 | .tx_cmd_protection = iwl_legacy_tx_cmd_protection, |
2518 | .calc_rssi = iwl4965_calc_rssi, | 2518 | .calc_rssi = iwl4965_calc_rssi, |
2519 | .request_scan = iwlagn_request_scan, | 2519 | .request_scan = iwlagn_request_scan, |
2520 | .post_scan = iwl4965_post_scan, | 2520 | .post_scan = iwl4965_post_scan, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index f8d801cc24fc..c884ed385fcf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -288,40 +288,6 @@ void iwlcore_free_geos(struct iwl_priv *priv) | |||
288 | } | 288 | } |
289 | EXPORT_SYMBOL(iwlcore_free_geos); | 289 | EXPORT_SYMBOL(iwlcore_free_geos); |
290 | 290 | ||
291 | /* | ||
292 | * iwlcore_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this | ||
293 | * function. | ||
294 | */ | ||
295 | void iwlcore_tx_cmd_protection(struct iwl_priv *priv, | ||
296 | struct ieee80211_tx_info *info, | ||
297 | __le16 fc, __le32 *tx_flags) | ||
298 | { | ||
299 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { | ||
300 | *tx_flags |= TX_CMD_FLG_RTS_MSK; | ||
301 | *tx_flags &= ~TX_CMD_FLG_CTS_MSK; | ||
302 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
303 | |||
304 | if (!ieee80211_is_mgmt(fc)) | ||
305 | return; | ||
306 | |||
307 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
308 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
309 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
310 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
311 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
312 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
313 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
314 | break; | ||
315 | } | ||
316 | } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) { | ||
317 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
318 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
319 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
320 | } | ||
321 | } | ||
322 | EXPORT_SYMBOL(iwlcore_tx_cmd_protection); | ||
323 | |||
324 | |||
325 | static bool iwl_is_channel_extension(struct iwl_priv *priv, | 291 | static bool iwl_is_channel_extension(struct iwl_priv *priv, |
326 | enum ieee80211_band band, | 292 | enum ieee80211_band band, |
327 | u16 channel, u8 extension_chan_offset) | 293 | u16 channel, u8 extension_chan_offset) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index c9723da040fc..6064bc412e07 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -447,9 +447,7 @@ int iwl_mac_change_interface(struct ieee80211_hw *hw, | |||
447 | enum nl80211_iftype newtype, bool newp2p); | 447 | enum nl80211_iftype newtype, bool newp2p); |
448 | int iwl_alloc_txq_mem(struct iwl_priv *priv); | 448 | int iwl_alloc_txq_mem(struct iwl_priv *priv); |
449 | void iwl_free_txq_mem(struct iwl_priv *priv); | 449 | void iwl_free_txq_mem(struct iwl_priv *priv); |
450 | void iwlcore_tx_cmd_protection(struct iwl_priv *priv, | 450 | |
451 | struct ieee80211_tx_info *info, | ||
452 | __le16 fc, __le32 *tx_flags); | ||
453 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 451 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
454 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | 452 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); |
455 | void iwl_free_traffic_mem(struct iwl_priv *priv); | 453 | void iwl_free_traffic_mem(struct iwl_priv *priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-legacy.c b/drivers/net/wireless/iwlwifi/iwl-legacy.c index f49e500cba67..10d9c4202875 100644 --- a/drivers/net/wireless/iwlwifi/iwl-legacy.c +++ b/drivers/net/wireless/iwlwifi/iwl-legacy.c | |||
@@ -620,3 +620,37 @@ none: | |||
620 | return IRQ_NONE; | 620 | return IRQ_NONE; |
621 | } | 621 | } |
622 | EXPORT_SYMBOL(iwl_isr_legacy); | 622 | EXPORT_SYMBOL(iwl_isr_legacy); |
623 | |||
624 | /* | ||
625 | * iwl_legacy_tx_cmd_protection: Set rts/cts. 3945 and 4965 only share this | ||
626 | * function. | ||
627 | */ | ||
628 | void iwl_legacy_tx_cmd_protection(struct iwl_priv *priv, | ||
629 | struct ieee80211_tx_info *info, | ||
630 | __le16 fc, __le32 *tx_flags) | ||
631 | { | ||
632 | if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) { | ||
633 | *tx_flags |= TX_CMD_FLG_RTS_MSK; | ||
634 | *tx_flags &= ~TX_CMD_FLG_CTS_MSK; | ||
635 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
636 | |||
637 | if (!ieee80211_is_mgmt(fc)) | ||
638 | return; | ||
639 | |||
640 | switch (fc & cpu_to_le16(IEEE80211_FCTL_STYPE)) { | ||
641 | case cpu_to_le16(IEEE80211_STYPE_AUTH): | ||
642 | case cpu_to_le16(IEEE80211_STYPE_DEAUTH): | ||
643 | case cpu_to_le16(IEEE80211_STYPE_ASSOC_REQ): | ||
644 | case cpu_to_le16(IEEE80211_STYPE_REASSOC_REQ): | ||
645 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
646 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
647 | break; | ||
648 | } | ||
649 | } else if (info->control.rates[0].flags & | ||
650 | IEEE80211_TX_RC_USE_CTS_PROTECT) { | ||
651 | *tx_flags &= ~TX_CMD_FLG_RTS_MSK; | ||
652 | *tx_flags |= TX_CMD_FLG_CTS_MSK; | ||
653 | *tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; | ||
654 | } | ||
655 | } | ||
656 | EXPORT_SYMBOL(iwl_legacy_tx_cmd_protection); | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-legacy.h b/drivers/net/wireless/iwlwifi/iwl-legacy.h index 81d1ccdb0746..9f7b2f935964 100644 --- a/drivers/net/wireless/iwlwifi/iwl-legacy.h +++ b/drivers/net/wireless/iwlwifi/iwl-legacy.h | |||
@@ -70,6 +70,9 @@ void iwl_legacy_mac_bss_info_changed(struct ieee80211_hw *hw, | |||
70 | struct ieee80211_vif *vif, | 70 | struct ieee80211_vif *vif, |
71 | struct ieee80211_bss_conf *bss_conf, | 71 | struct ieee80211_bss_conf *bss_conf, |
72 | u32 changes); | 72 | u32 changes); |
73 | void iwl_legacy_tx_cmd_protection(struct iwl_priv *priv, | ||
74 | struct ieee80211_tx_info *info, | ||
75 | __le16 fc, __le32 *tx_flags); | ||
73 | 76 | ||
74 | irqreturn_t iwl_isr_legacy(int irq, void *data); | 77 | irqreturn_t iwl_isr_legacy(int irq, void *data); |
75 | 78 | ||