mac80211/iwlwifi (#everything): integrate IEEE802.11n support
cover mac80211/iwlwifi (#everything): integrate IEEE802.11n support
This series of patches contains all 802.11n code + fixes of comments to the first two cycles of 802.11n patches.
Fixed list:
===========
- removing MAC80211_HT from config and all *.[ch] files
- removing IWL4965 config dependency on MAC80211_HT
- adding MAC80211_HT_DEBUG to config file and to relevant places
- refine TODO remark in ieee80211_sta_process_addba_request
- net_ratelimit() added to relevant prints
- renaming ieee80211_rx_h_data_agg to ieee80211_rx_h_amsdu
- removing parentheses from IEEE80211_CONF_SUPPORT_HT_MODE use
- changing amsdu_frame type from u16 to u8
- adding define SUPP_MCS_SET_LEN 16 to indicate MCS set length
- fixes to some typos
- Changes to Rx handlers PAE and drop unencrypted (for EAPOL frames in amsdu)
If this series is accepted then next series will contain the follow:
TODO list (planned for next series of patches)
==============================================
- Full A-MPDU aggregation capability.
- AP flows
- Examine config flows in mac80211 (RFC is prepered)
Notes to this series:
======================
This series of patches splits into two parts:
- patches 1-7 add 802.11n support to mac80211.
- patches 8-15 demonstrates the use of the above mac80211's 802.11n framework through iwl4965 low level driver
In order to be compatible with the 802.11n requirements for an HT station, patches 1-7 should not be treated as stand alone patches, but as a complete framework, although separation to patches by subjects was made for ease of handling. This applies to patches 8-15 as well.
The patches do _not_ break any existing driver.
patches were made (and tested to work) with wireless branch 2.6.24-rc3 (#everything)
The framework includes the following:
- HT probing.
- HT association.
- Support in Rx A-MSDU.
- Support in A-MPDU addBA request.
- HT information and configuration delivery to both low-level driver and rate scaling.
---------------------------------------------------------------------
Intel Israel (74) Limited
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 1/15 mac80211: adding MAC80211_HT_DEBUG config variable
This patch adds MAC80211_HT_DEBUG config variable
to separate HT debug features
--- net/mac80211/Kconfig | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)
net/mac80211/Kconfig +10 -0
@@ -51,6 +51,16 @@ config MAC80211_DEBUG If you are not trying to debug or develop the ieee80211 subsystem, you most likely want to say N here. +config MAC80211_HT_DEBUG + bool "Enable HT debugging output" + depends on MAC80211_DEBUG + ---help--- + This option enables 802.11n High Throughput features + debug tracing output. + + If you are not trying to debug of develop the ieee80211 + subsystem, you most likely want to say N here. + config MAC80211_VERBOSE_DEBUG bool "Verbose debugging output" depends on MAC80211_DEBUG
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 01/15] mac80211: adding MAC80211_HT_DEBUG config variable
Quoted 4 lines · Ron Rindjunsky
This patch adds
MAC80211_HT_DEBUGconfig variable
to separate HT debug featuresSigned-off-by Ron Rindjunsky <[email protected]>
Quoted 25 lines
--- net/mac80211/Kconfig | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)net/mac80211/Kconfig +10
-0@@ -51,6 +51,16 @@ config MAC80211_DEBUG If you are not trying to debug or develop the ieee80211 subsystem, you most likely want to say N here. +config MAC80211_HT_DEBUG + bool "Enable HT debugging output" + depends on MAC80211_DEBUG + ---help--- + This option enables 802.11n High Throughput features + debug tracing output. + + If you are not trying to debug of develop the ieee80211 + subsystem, you most likely want to say N here. + config MAC80211_VERBOSE_DEBUG bool "Verbose debugging output" depends on MAC80211_DEBUG
PATCH 2/15 mac80211: adding 802.11n definitions in ieee80211.h
In reply to Ron RindjunskyThis patch adds several structs and definitions to ieee80211.h to support 802.11n draft specifications.
As 802.11n depends on and extends the 802.11e standard in several issues, there are also several definitions that belong to 802.11e.
--- include/linux/ieee80211.h | 134 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 134 insertions(+), 0 deletions(-)
include/linux/ieee80211.h +134 -0
@@ -54,6 +54,8 @@#define IEEE80211_STYPE_ACTION 0x00D0/* control */ +#define IEEE80211_STYPE_BACK_REQ 0x0080 +#define IEEE80211_STYPE_BACK 0x0090#define IEEE80211_STYPE_PSPOLL 0x00A0#define IEEE80211_STYPE_RTS 0x00B0#define IEEE80211_STYPE_CTS 0x00C0
@@ -185,6 +187,25 @@ struct ieee80211_mgmt {u8 new_chan;u8 switch_count; } __attribute__((packed)) chan_switch; +struct { +u8 action_code; +u8 dialog_token; +__le16 capab; +__le16 timeout; +__le16 start_seq_num; + } __attribute__((packed)) addba_req; +struct { +u8 action_code; +u8 dialog_token; +__le16 status; +__le16 capab; +__le16 timeout; + } __attribute__((packed)) addba_resp; +struct { +u8 action_code; +__le16 params; +__le16 reason_code; + } __attribute__((packed)) delba; } u; } __attribute__ ((packed)) action; } u;
@@ -205,6 +226,66 @@ struct ieee80211_cts {u8 ra[6 ]; } __attribute__ ((packed)); +/** +* struct ieee80211_bar - HT Block Ack Request +* +* This structure refers to "HT BlockAckReq" as +* described in 802.11n draft section 7.2.1.7.1 +*/ +struct ieee80211_bar { +__le16 frame_control; +__le16 duration; +__u8 ra[6 ]; +__u8 ta[6 ]; +__u16 control; +__u16 start_seq_num; +} __attribute__((packed)); + +/** +* struct ieee80211_ht_cap - HT capabilities +* +* This structure refers to "HT capabilities element" as +* described in 802.11n draft section 7.3.2.52 +*/ +struct ieee80211_ht_cap { +__le16 cap_info; +u8 ampdu_params_info; +u8 supp_mcs_set[16 ]; +__le16 extended_ht_cap_info; +__le32 tx_BF_cap_info; +u8 antenna_selection_info; +} __attribute__ ((packed)); + +/** +* struct ieee80211_ht_addt_info - HT additional information +* +* This structure refers to "HT information element" as +* described in 802.11n draft section 7.3.2.53 +*/ +struct ieee80211_ht_addt_info { +u8 control_chan; +u8 ht_param; +__le16 operation_mode; +__le16 stbc_param; +u8 basic_set[16 ]; +} __attribute__ ((packed)); + +/* 802.11n HT capabilities masks */ +#define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 +#define IEEE80211_HT_CAP_MIMO_PS 0x000C +#define IEEE80211_HT_CAP_GRN_FLD 0x0010 +#define IEEE80211_HT_CAP_SGI_20 0x0020 +#define IEEE80211_HT_CAP_SGI_40 0x0040 +#define IEEE80211_HT_CAP_DELAY_BA 0x0400 +#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 +#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 +#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C +/* 802.11n HT IE masks */ +#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 +#define IEEE80211_HT_IE_CHA_WIDTH 0x04 +#define IEEE80211_HT_IE_HT_PROTECTION 0x0003 +#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 +#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010/* Authentication algorithms */ #define WLAN_AUTH_OPEN 0
@@ -271,6 +352,18 @@ enum ieee80211_statuscode {WLAN_STATUS_UNSUPP_RSN_VERSION =44 ,WLAN_STATUS_INVALID_RSN_IE_CAP =45 ,WLAN_STATUS_CIPHER_SUITE_REJECTED =46 , +/* 802.11e */ +WLAN_STATUS_UNSPECIFIED_QOS =32 , +WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH =33 , +WLAN_STATUS_ASSOC_DENIED_LOWACK =34 , +WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS =35 , +WLAN_STATUS_REQUEST_DECLINED =37 , +WLAN_STATUS_INVALID_QOS_PARAM =38 , +WLAN_STATUS_CHANGE_TSPEC =39 , +WLAN_STATUS_WAIT_TS_DELAY =47 , +WLAN_STATUS_NO_DIRECT_LINK =48 , +WLAN_STATUS_STA_NOT_PRESENT =49 , + WLAN_STATUS_STA_NOT_QSTA = 50, };
@@ -301,6 +394,16 @@ enum ieee80211_reasoncode {WLAN_REASON_INVALID_RSN_IE_CAP =22 ,WLAN_REASON_IEEE8021X_FAILED =23 ,WLAN_REASON_CIPHER_SUITE_REJECTED =24 , +/* 802.11e */ +WLAN_REASON_DISASSOC_UNSPECIFIED_QOS =32 , +WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH =33 , +WLAN_REASON_DISASSOC_LOW_ACK =34 , +WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP =35 , +WLAN_REASON_QSTA_LEAVE_QBSS =36 , +WLAN_REASON_QSTA_NOT_USE =37 , +WLAN_REASON_QSTA_REQUIRE_SETUP =38 , +WLAN_REASON_QSTA_TIMEOUT =39 , + WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, };
@@ -319,6 +422,15 @@ enum ieee80211_eid {WLAN_EID_HP_PARAMS =8 ,WLAN_EID_HP_TABLE =9 ,WLAN_EID_REQUEST =10 , +/* 802.11e */ +WLAN_EID_QBSS_LOAD =11 , +WLAN_EID_EDCA_PARAM_SET =12 , +WLAN_EID_TSPEC =13 , +WLAN_EID_TCLAS =14 , +WLAN_EID_SCHEDULE =15 , +WLAN_EID_TS_DELAY =43 , +WLAN_EID_TCLAS_PROCESSING =44 , +WLAN_EID_QOS_CAPA =46 ,/* 802.11h */ WLAN_EID_PWR_CONSTRAINT =32 , WLAN_EID_PWR_CAPABILITY = 33,
@@ -333,6 +445,9 @@ enum ieee80211_eid {/* 802.11g */ WLAN_EID_ERP_INFO =42 ,WLAN_EID_EXT_SUPP_RATES =50 , +/* 802.11n */ +WLAN_EID_HT_CAPABILITY =45 , +WLAN_EID_HT_EXTRA_INFO =61 ,/* 802.11i */ WLAN_EID_RSN =48 , WLAN_EID_WPA = 221,
@@ -341,6 +456,25 @@ enum ieee80211_eid { WLAN_EID_QOS_PARAMETER = 222 }; +/* Action category code */ +enum ieee80211_category { +WLAN_CATEGORY_SPECTRUM_MGMT =0 , +WLAN_CATEGORY_QOS =1 , +WLAN_CATEGORY_DLS =2 , +WLAN_CATEGORY_BACK =3 , +WLAN_CATEGORY_WMM =17 , +}; + +/* BACK action code */ +enum ieee80211_back_actioncode { +WLAN_ACTION_ADDBA_REQ =0 , +WLAN_ACTION_ADDBA_RESP =1 , +WLAN_ACTION_DELBA =2 , +}; + +/* A-MSDU 802.11n */ +#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080 +/* cipher suite selectors */ #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Johannes Berg
maintainerRe: [PATCH 02/15] mac80211: adding 802.11n definitions in ieee80211.h
Quoted 6 lines · Ron Rindjunsky
This patch adds several structs and definitions to
ieee80211.hto support 802.11n draft specifications.
As 802.11n depends on and extends the 802.11e standard in several issues, there are also several definitions that belong to 802.11e.Signed-off-by Ron Rindjunsky <[email protected]>
This already went in :)
PATCH 3/15 mac80211: adding 802.11n HT framework definitions
In reply to Ron RindjunskyNew structures:
- ieee80211_ht_info: describing STA's HT capabilities
- ieee80211_ht_bss_info: describing BSS's HT characteristics
Changed structures:
- ieee80211_hw_mode: now also holds PHY HT capabilities for each HW mode
- ieee80211_conf: ht_conf holds current self HT configuration ht_bss_conf holds current BSS HT configuration
- flag IEEE80211_CONF_SUPPORT_HT_MODE added to indicate if HT use is desired
- sta_info: now also holds Peer's HT capabilities
--- include/net/mac80211.h | 55 +++++++++++++++++++++++++++++++++++++++++----- net/mac80211/sta_info.h | 3 ++ 2 files changed, 52 insertions(+), 6 deletions(-)
include/net/mac80211.h +49 -6
@@ -139,17 +139,54 @@ enum ieee80211_phymode { };/** +* struct ieee80211_ht_info - describing STA's HT capabilities +* +* This structure describes most essential parameters needed +* to describe 802.11n HT capabilities for an STA. +* +* @ht_supported: is HT supported by STA, 0: no, 1: yes +* @cap: HT capabilities map as described in 802.11n spec +* @ampdu_factor: Maximum A-MPDU length factor +* @ampdu_density: Minimum A-MPDU spacing +* @supp_mcs_set: Supported MCS set as described in 802.11n spec +*/ +struct ieee80211_ht_info { +u8 ht_supported; +u16 cap;/* use IEEE80211_HT_CAP_ */ +u8 ampdu_factor; +u8 ampdu_density; +u8 supp_mcs_set[16 ]; +}; + +/** +* struct ieee80211_ht_bss_info - describing BSS's HT characteristics +* +* This structure describes most essential parameters needed +* to describe 802.11n HT characteristics in a BSS +* +* @primary_channel: channel number of primery channel +* @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) +* @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection) +*/ +struct ieee80211_ht_bss_info { +u8 primary_channel; +u8 bss_cap;/* use IEEE80211_HT_IE_CHA_ */ +u8 bss_op_mode;/* use IEEE80211_HT_IE_ */ +}; + +/** * struct ieee80211_hw_mode - PHY mode definition * * This structure describes the capabilities supported by the device * in a single PHY mode. * +* @list: internal +* @channels: pointer to array of supported channels +* @rates: pointer to array of supported bitrates * @mode: the PHY mode for this definition * @num_channels: number of supported channels -* @channels: pointer to array of supported channels * @num_rates: number of supported bitrates -* @rates: pointer to array of supported bitrates -* @list: internal +* @ht_info: PHY's 802.11n HT abilities for this mode */ struct ieee80211_hw_mode {struct list_head list;
@@ -158,6 +195,7 @@ struct ieee80211_hw_mode {enum ieee80211_phymode mode;int num_channels;int num_rates; +struct ieee80211_ht_info ht_info; };/**
@@ -406,11 +444,12 @@ struct ieee80211_tx_status {* * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) -* +* @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) */ enum ieee80211_conf_flags { -IEEE80211_CONF_SHORT_SLOT_TIME =1 <<0 , -IEEE80211_CONF_RADIOTAP =1 <<1 , +IEEE80211_CONF_SHORT_SLOT_TIME = (1 <<0 ), +IEEE80211_CONF_RADIOTAP = (1 <<1 ), +IEEE80211_CONF_SUPPORT_HT_MODE = (1 <<2 ), };/**
@@ -434,6 +473,8 @@ enum ieee80211_conf_flags {* @antenna_sel_tx: transmit antenna selection, 0: default/diversity, * 1/2: antenna 0/1 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx +* @ht_conf: describes current self configuration of 802.11n HT capabilies +* @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters */ struct ieee80211_conf {int channel;/* IEEE 802.11 channel number */
@@ -452,6 +493,8 @@ struct ieee80211_conf {u8 antenna_max;u8 antenna_sel_tx;u8 antenna_sel_rx; +struct ieee80211_ht_info ht_conf; +struct ieee80211_ht_bss_info ht_bss_conf; };/**
net/mac80211/sta_info.h +3 -0
@@ -99,6 +99,9 @@ struct sta_info {u16 listen_interval; +struct ieee80211_ht_info ht_info;/* 802.11n HT capabilities +of this STA */ + #ifdef CONFIG_MAC80211_DEBUGFS struct sta_info_debugfsdentries { struct dentry *dir;
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 03/15] mac80211: adding 802.11n HT framework definitions
Quoted 11 lines · Ron Rindjunsky
New structures:
-ieee80211_ht_info: describing STA's HT capabilities
-ieee80211_ht_bss_info: describing BSS's HT characteristics
Changed structures:
-ieee80211_hw_mode: now also holds PHY HT capabilities for each HW mode
-ieee80211_conf:ht_confholds current self HT configurationht_bss_confholds current BSS HT configuration
- flagIEEE80211_CONF_SUPPORT_HT_MODEadded to indicate if HT use is desired
-sta_info: now also holds Peer's HT capabilities
Quoted 1 line
Signed-off-by Ron Rindjunsky <[email protected]>
Looks good, we'll do the bss parameter work on top of this.
Quoted 123 lines
--- include/net/mac80211.h | 55 +++++++++++++++++++++++++++++++++++++++++----- net/mac80211/sta_info.h | 3 ++ 2 files changed, 52 insertions(+), 6 deletions(-)include/net/mac80211.h +49
-6@@ -139,17 +139,54 @@ enum ieee80211_phymode { };/** +* struct ieee80211_ht_info - describing STA's HT capabilities +* +* This structure describes most essential parameters needed +* to describe 802.11n HT capabilities for an STA. +* +* @ht_supported: is HT supported by STA, 0: no, 1: yes +* @cap: HT capabilities map as described in 802.11n spec +* @ampdu_factor: Maximum A-MPDU length factor +* @ampdu_density: Minimum A-MPDU spacing +* @supp_mcs_set: Supported MCS set as described in 802.11n spec +*/ +struct ieee80211_ht_info { +u8 ht_supported; +u16 cap;/* use IEEE80211_HT_CAP_ */ +u8 ampdu_factor; +u8 ampdu_density; +u8 supp_mcs_set[16 ]; +}; + +/** +* struct ieee80211_ht_bss_info - describing BSS's HT characteristics +* +* This structure describes most essential parameters needed +* to describe 802.11n HT characteristics in a BSS +* +* @primary_channel: channel number of primery channel +* @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) +* @bss_op_mode: 802.11n's BSS operation modes (e.g. HT protection) +*/ +struct ieee80211_ht_bss_info { +u8 primary_channel; +u8 bss_cap;/* use IEEE80211_HT_IE_CHA_ */ +u8 bss_op_mode;/* use IEEE80211_HT_IE_ */ +}; + +/** * struct ieee80211_hw_mode - PHY mode definition * * This structure describes the capabilities supported by the device * in a single PHY mode. * +* @list: internal +* @channels: pointer to array of supported channels +* @rates: pointer to array of supported bitrates * @mode: the PHY mode for this definition * @num_channels: number of supported channels -* @channels: pointer to array of supported channels * @num_rates: number of supported bitrates -* @rates: pointer to array of supported bitrates -* @list: internal +* @ht_info: PHY's 802.11n HT abilities for this mode */ struct ieee80211_hw_mode {struct list_head list;@@ -158,6 +195,7 @@ struct ieee80211_hw_mode {enum ieee80211_phymode mode;int num_channels;int num_rates; +struct ieee80211_ht_info ht_info; };/** @@ -406,11 +444,12 @@ struct ieee80211_tx_status {* * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) -* +* @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) */ enum ieee80211_conf_flags { -IEEE80211_CONF_SHORT_SLOT_TIME =1 <<0 , -IEEE80211_CONF_RADIOTAP =1 <<1 , +IEEE80211_CONF_SHORT_SLOT_TIME = (1 <<0 ), +IEEE80211_CONF_RADIOTAP = (1 <<1 ), +IEEE80211_CONF_SUPPORT_HT_MODE = (1 <<2 ), };/** @@ -434,6 +473,8 @@ enum ieee80211_conf_flags {* @antenna_sel_tx: transmit antenna selection, 0: default/diversity, * 1/2: antenna 0/1 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx +* @ht_conf: describes current self configuration of 802.11n HT capabilies +* @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters */ struct ieee80211_conf {int channel;/* IEEE 802.11 channel number */ @@ -452,6 +493,8 @@ struct ieee80211_conf {u8 antenna_max;u8 antenna_sel_tx;u8 antenna_sel_rx; +struct ieee80211_ht_info ht_conf; +struct ieee80211_ht_bss_info ht_bss_conf; };/** net/mac80211/sta_info.h +3
-0@@ -99,6 +99,9 @@ struct sta_info {u16 listen_interval; +struct ieee80211_ht_info ht_info;/* 802.11n HT capabilities +of this STA */ + #ifdef CONFIG_MAC80211_DEBUGFS struct sta_info_debugfsdentries { struct dentry *dir;
PATCH 4/15 mac80211: adding 802.11n IEs handling
In reply to Ron RindjunskyThis patch presents the ability to parse and compose HT IEs, and to put the IE relevant data inside the mac80211's internal HT structures
--- net/mac80211/ieee80211_i.h | 8 +++- net/mac80211/ieee80211_sta.c | 89 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 94 insertions(+), 3 deletions(-)
net/mac80211/ieee80211_i.h +7 -1
@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;#define IEEE80211_MAX_SUPP_RATES 32u8 supp_rates[IEEE80211_MAX_SUPP_RATES ];size_t supp_rates_len;
@@ -761,7 +763,11 @@ int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason);int ieee80211_sta_disassociate (struct net_device *dev,u16 reason);void ieee80211_erp_info_change_notify (struct net_device *dev,u8 changes);void ieee80211_reset_erp_info (struct net_device *dev); - +int ieee80211_ht_cap_ie_to_ht_info (struct ieee80211_ht_cap *ht_cap_ie, +struct ieee80211_ht_info *ht_info); +int ieee80211_ht_addt_info_ie_to_ht_bss_info ( +struct ieee80211_ht_addt_info *ht_add_info_ie, +struct ieee80211_ht_bss_info *bss_info);/* ieee80211_iface.c */ int ieee80211_if_add (struct net_device *dev,const char *name,struct net_device **new_dev,int type);
net/mac80211/ieee80211_sta.c +87 -2
131 lines not on this page · raw message
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 04/15] mac80211: adding 802.11n IEs handling
Quoted 4 lines · Ron Rindjunsky
This patch presents the ability to parse and compose HT IEs, and to put the IE relevant data inside the mac80211's internal HT structures
Signed-off-by Ron Rindjunsky <[email protected]>
Looks good.
net/mac80211/ieee80211_i.h struct ieee80211_sta_bss { · line 93
Quoted 10 lines
net/mac80211/ieee80211_i.h +2
-0@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;
At some point we probably should reorder the fields here to avoid all the padding... Not in this patch though, of course.
johannes
Re: [PATCH 04/15] mac80211: adding 802.11n IEs handling
Quoted 14 lines · Johannes Berg
net/mac80211/ieee80211_i.h struct ieee80211_sta_bss { · line 93
Quoted 10 lines · Ron Rindjunsky
net/mac80211/ieee80211_i.h +2
-0@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;At some point we probably should reorder the fields here to avoid all the padding... Not in this patch though, of course.
There should not be any padding, size_t has the same size as a pointer.
Andreas.
--=20
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4= ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerRe: [PATCH 04/15] mac80211: adding 802.11n IEs handling
Quoted 16 lines
Quoted 7 lines · Ron Rindjunsky
Quoted 5 lines
net/mac80211/ieee80211_i.h +0
-0@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {Quoted 8 lines
net/mac80211/ieee80211_i.h struct ieee80211_sta_bss { · line 93
Quoted 5 lines
net/mac80211/ieee80211_i.h +2
-0size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;At some point we probably should reorder the fields here to avoid all the padding... Not in this patch though, of course.
Quoted 1 line
There should not be any padding,
size_thas the same size as a pointer.
Even on 64-bit? In any case, the _len vars can all be u8 too.
johannes
Re: [PATCH 04/15] mac80211: adding 802.11n IEs handling
Quoted 2 lines · Johannes Berg
Quoted 2 lines
Quoted 2 lines · Ron Rindjunsky
net/mac80211/ieee80211_=
Quoted 1 line
net/mac80211/ieee80211_= renamed from net/mac80211/ieee80211_i.h +0
-0
i.h
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
net/mac80211/ieee80211_i.h struct ieee80211_sta_bss { · line 93
Quoted 9 lines
index 9e5b3a9..9caf124 100644
net/mac80211/ieee80211_i.h +2
-0@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;At some point we probably should reorder the fields here to avoid =
all
Quoted 3 lines
Quoted 3 lines
Quoted 1 line
the padding... Not in this patch though, of course.
=20
There should not be any padding,size_thas the same size as a point=
er.
Quoted 2 lines
Even on 64-bit? In any case, the
_lenvars can all be u8 too.
I think you are missing a couple of '*'s here.
Andreas.
--=20
Andreas Schwab, SuSE Labs, [email protected]
SuSE Linux Products GmbH, Maxfeldstra=DFe 5, 90409 N=FCrnberg, Germany PGP key fingerprint =3D 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4= ED5
"And now for something completely different."
-
To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Johannes Berg
maintainerRe: [PATCH 04/15] mac80211: adding 802.11n IEs handling
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 10 lines
net/mac80211/ieee80211_i.h struct ieee80211_sta_bss { · line 93
Quoted 7 lines
net/mac80211/ieee80211_i.h +2
-0@@ -89,6 +89,8 @@ struct ieee80211_sta_bss {size_t rsn_ie_len;u8 *wmm_ie;size_t wmm_ie_len; +u8 *ht_ie; +size_t ht_ie_len;At some point we probably should reorder the fields here to avoid all the padding... Not in this patch though, of course.
Quoted 5 lines
Quoted 3 lines
Quoted 1 line
There should not be any padding,
size_thas the same size as a pointer.Even on 64-bit? In any case, the
_lenvars can all be u8 too.I think you are missing a couple of '*'s here.
No. I just thought size_t would be 32 bits, and all the size_t can be replaced by u8 since IEs cannot be longer than that.
johannes
PATCH 5/15 mac80211: adding 802.11n essential A-MPDU addBA capability
In reply to Ron RindjunskyThis patch adds the capability to identify and answer an add block ACK request.
As this series of patches only adds HT handling with no aggregations, (A-MPDU aggregations acceptance is not obligatory according to 802.11n draft) we are currently sending back a refusal upon this request.
--- net/mac80211/ieee80211_sta.c | 124 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-)
net/mac80211/ieee80211_sta.c +124 -0
@@ -57,6 +57,13 @@#define ERP_INFO_USE_PROTECTION BIT(1) +/* mgmt header + 1 byte action code */ +#define IEEE80211_MIN_ACTION_SIZE (24 + 1) + +#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 +#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C +#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 +static void ieee80211_send_probe_req (struct net_device *dev,u8 *dst,u8 *ssid,size_t ssid_len); static struct ieee80211_sta_bss *
@@ -991,6 +998,91 @@ static void ieee80211_auth_challenge(struct net_device *dev, elems.challenge_len + 2, 1); } +static void ieee80211_send_addba_resp (struct net_device *dev,u8 *da,u16 tid, +u8 dialog_token,u16 status,u16 policy, +u16 buf_size,u16 timeout) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +struct ieee80211_if_sta *ifsta = &sdata->u.sta; +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct sk_buff *skb; +struct ieee80211_mgmt *mgmt; +u16 capab; + + skb =dev_alloc_skb (sizeof (*mgmt) + local->hw.extra_tx_headroom); +if (!skb) { +printk (KERN_DEBUG "%s: failed to allocate buffer " +"for addba resp frame\n" , dev->name); +return ; + } + +skb_reserve (skb, local->hw.extra_tx_headroom); + mgmt = (struct ieee80211_mgmt *)skb_put (skb,24 ); +memset (mgmt,0 ,24 ); +memcpy (mgmt->da, da,ETH_ALEN ); +memcpy (mgmt->sa, dev->dev_addr,ETH_ALEN ); +if (sdata->type ==IEEE80211_IF_TYPE_AP ) +memcpy (mgmt->bssid, dev->dev_addr,ETH_ALEN ); +else +memcpy (mgmt->bssid, ifsta->bssid,ETH_ALEN ); + mgmt->frame_control =IEEE80211_FC (IEEE80211_FTYPE_MGMT , +IEEE80211_STYPE_ACTION ); + +skb_put (skb,1 +sizeof (mgmt->u.action.u.addba_resp)); + mgmt->u.action.category =WLAN_CATEGORY_BACK ; + mgmt->u.action.u.addba_resp.action_code =WLAN_ACTION_ADDBA_RESP ; + mgmt->u.action.u.addba_resp.dialog_token = dialog_token; + + capab = (u16)(policy <<1 );/* bit 1 aggregation policy */ + capab |= (u16)(tid <<2 );/* bit 5:2 TID number */ + capab |= (u16)(buf_size <<6 );/* bit 15:6 max size of aggregation */ + + mgmt->u.action.u.addba_resp.capab =cpu_to_le16 (capab); + mgmt->u.action.u.addba_resp.timeout =cpu_to_le16 (timeout); + mgmt->u.action.u.addba_resp.status =cpu_to_le16 (status); + +ieee80211_sta_tx (dev, skb,0 ); + +return ; +} + +static void ieee80211_sta_process_addba_request (struct net_device *dev, +struct ieee80211_mgmt *mgmt, +size_t len) +{ +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct sta_info *sta; +u16 capab, tid, timeout, ba_policy, buf_size, status; +u8 dialog_token; + + sta =sta_info_get (local, mgmt->sa); +if (!sta) +return ; + +/* extract session parameters from addba request frame */ + dialog_token = mgmt->u.action.u.addba_req.dialog_token; + timeout =le16_to_cpu (mgmt->u.action.u.addba_req.timeout); + + capab =le16_to_cpu (mgmt->u.action.u.addba_req.capab); + ba_policy = (capab &IEEE80211_ADDBA_PARAM_POLICY_MASK ) >>1 ; + tid = (capab &IEEE80211_ADDBA_PARAM_TID_MASK ) >>2 ; + buf_size = (capab &IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK ) >>6 ; + +/* TODO - currently aggregation is declined (A-MPDU add BA request +* acceptance is not obligatory by 802.11n draft), but here is +* the entry point for dealing with it */ +#ifdef MAC80211_HT_DEBUG +if (net_ratelimit ()) +printk (KERN_DEBUG "Add Block Ack request arrived," +" currently denying it\n" ); +#endif /* MAC80211_HT_DEBUG */ + + status =WLAN_STATUS_REQUEST_DECLINED ; + +ieee80211_send_addba_resp (sta->dev, sta->addr, tid, dialog_token, + status,1 , buf_size, timeout); +sta_info_put (sta); +} static void ieee80211_rx_mgmt_auth(struct net_device *dev, struct ieee80211_if_sta *ifsta,
@@ -1864,6 +1956,34 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,ieee80211_sta_tx (dev, skb,0 ); } +void ieee80211_rx_mgmt_action (struct net_device *dev, +struct ieee80211_if_sta *ifsta, +struct ieee80211_mgmt *mgmt, +size_t len) +{ +if (len <IEEE80211_MIN_ACTION_SIZE ) +return ; + +switch (mgmt->u.action.category) { +case WLAN_CATEGORY_BACK : +switch (mgmt->u.action.u.addba_req.action_code) { +case WLAN_ACTION_ADDBA_REQ : +if (len < (IEEE80211_MIN_ACTION_SIZE + +sizeof (mgmt->u.action.u.addba_req))) +break ; +ieee80211_sta_process_addba_request (dev, mgmt, len); +break ; +default : +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: received unsupported BACK\n" , + dev->name); +break ; + } +break ; +default : +break ; + } +}void ieee80211_sta_rx_mgmt (struct net_device *dev,struct sk_buff *skb,struct ieee80211_rx_status *rx_status)
@@ -1893,6 +2013,7 @@ void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb,case IEEE80211_STYPE_REASSOC_RESP :case IEEE80211_STYPE_DEAUTH :case IEEE80211_STYPE_DISASSOC : +case IEEE80211_STYPE_ACTION :skb_queue_tail (&ifsta->skb_queue, skb);queue_work (local->hw.workqueue, &ifsta->work);return ;
@@ -1950,6 +2071,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct net_device *dev,case IEEE80211_STYPE_DISASSOC :ieee80211_rx_mgmt_disassoc (dev, ifsta, mgmt, skb->len);break ; +case IEEE80211_STYPE_ACTION : +ieee80211_rx_mgmt_action (dev, ifsta, mgmt, skb->len); +break ; }kfree_skb (skb);
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 05/15] mac80211: adding 802.11n essential A-MPDU addBA capability
Quoted 7 lines · Ron Rindjunsky
This patch adds the capability to identify and answer an add block ACK request.
As this series of patches only adds HT handling with no aggregations, (A-MPDU aggregations acceptance is not obligatory according to 802.11n draft) we are currently sending back a refusal upon this request.Signed-off-by Ron Rindjunsky <[email protected]>
Do you have a plan already on how to fill in that TODO? Just curious.
Quoted 167 lines
--- net/mac80211/ieee80211_sta.c | 124 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 124 insertions(+), 0 deletions(-)net/mac80211/ieee80211_sta.c +124
-0@@ -57,6 +57,13 @@#define ERP_INFO_USE_PROTECTION BIT(1) +/* mgmt header + 1 byte action code */ +#define IEEE80211_MIN_ACTION_SIZE (24 + 1) + +#define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 +#define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C +#define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 +static void ieee80211_send_probe_req (struct net_device *dev,u8 *dst,u8 *ssid,size_t ssid_len); static struct ieee80211_sta_bss *@@ -991,6 +998,91 @@ static void ieee80211_auth_challenge(struct net_device *dev, elems.challenge_len + 2, 1); } +static void ieee80211_send_addba_resp (struct net_device *dev,u8 *da,u16 tid, +u8 dialog_token,u16 status,u16 policy, +u16 buf_size,u16 timeout) +{ +struct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev); +struct ieee80211_if_sta *ifsta = &sdata->u.sta; +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct sk_buff *skb; +struct ieee80211_mgmt *mgmt; +u16 capab; + + skb =dev_alloc_skb (sizeof (*mgmt) + local->hw.extra_tx_headroom); +if (!skb) { +printk (KERN_DEBUG "%s: failed to allocate buffer " +"for addba resp frame\n" , dev->name); +return ; + } + +skb_reserve (skb, local->hw.extra_tx_headroom); + mgmt = (struct ieee80211_mgmt *)skb_put (skb,24 ); +memset (mgmt,0 ,24 ); +memcpy (mgmt->da, da,ETH_ALEN ); +memcpy (mgmt->sa, dev->dev_addr,ETH_ALEN ); +if (sdata->type ==IEEE80211_IF_TYPE_AP ) +memcpy (mgmt->bssid, dev->dev_addr,ETH_ALEN ); +else +memcpy (mgmt->bssid, ifsta->bssid,ETH_ALEN ); + mgmt->frame_control =IEEE80211_FC (IEEE80211_FTYPE_MGMT , +IEEE80211_STYPE_ACTION ); + +skb_put (skb,1 +sizeof (mgmt->u.action.u.addba_resp)); + mgmt->u.action.category =WLAN_CATEGORY_BACK ; + mgmt->u.action.u.addba_resp.action_code =WLAN_ACTION_ADDBA_RESP ; + mgmt->u.action.u.addba_resp.dialog_token = dialog_token; + + capab = (u16)(policy <<1 );/* bit 1 aggregation policy */ + capab |= (u16)(tid <<2 );/* bit 5:2 TID number */ + capab |= (u16)(buf_size <<6 );/* bit 15:6 max size of aggregation */ + + mgmt->u.action.u.addba_resp.capab =cpu_to_le16 (capab); + mgmt->u.action.u.addba_resp.timeout =cpu_to_le16 (timeout); + mgmt->u.action.u.addba_resp.status =cpu_to_le16 (status); + +ieee80211_sta_tx (dev, skb,0 ); + +return ; +} + +static void ieee80211_sta_process_addba_request (struct net_device *dev, +struct ieee80211_mgmt *mgmt, +size_t len) +{ +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct sta_info *sta; +u16 capab, tid, timeout, ba_policy, buf_size, status; +u8 dialog_token; + + sta =sta_info_get (local, mgmt->sa); +if (!sta) +return ; + +/* extract session parameters from addba request frame */ + dialog_token = mgmt->u.action.u.addba_req.dialog_token; + timeout =le16_to_cpu (mgmt->u.action.u.addba_req.timeout); + + capab =le16_to_cpu (mgmt->u.action.u.addba_req.capab); + ba_policy = (capab &IEEE80211_ADDBA_PARAM_POLICY_MASK ) >>1 ; + tid = (capab &IEEE80211_ADDBA_PARAM_TID_MASK ) >>2 ; + buf_size = (capab &IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK ) >>6 ; + +/* TODO - currently aggregation is declined (A-MPDU add BA request +* acceptance is not obligatory by 802.11n draft), but here is +* the entry point for dealing with it */ +#ifdef MAC80211_HT_DEBUG +if (net_ratelimit ()) +printk (KERN_DEBUG "Add Block Ack request arrived," +" currently denying it\n" ); +#endif /* MAC80211_HT_DEBUG */ + + status =WLAN_STATUS_REQUEST_DECLINED ; + +ieee80211_send_addba_resp (sta->dev, sta->addr, tid, dialog_token, + status,1 , buf_size, timeout); +sta_info_put (sta); +} static void ieee80211_rx_mgmt_auth(struct net_device *dev, struct ieee80211_if_sta *ifsta,@@ -1864,6 +1956,34 @@ static void ieee80211_rx_mgmt_probe_req(struct net_device *dev,ieee80211_sta_tx (dev, skb,0 ); } +void ieee80211_rx_mgmt_action (struct net_device *dev, +struct ieee80211_if_sta *ifsta, +struct ieee80211_mgmt *mgmt, +size_t len) +{ +if (len <IEEE80211_MIN_ACTION_SIZE ) +return ; + +switch (mgmt->u.action.category) { +case WLAN_CATEGORY_BACK : +switch (mgmt->u.action.u.addba_req.action_code) { +case WLAN_ACTION_ADDBA_REQ : +if (len < (IEEE80211_MIN_ACTION_SIZE + +sizeof (mgmt->u.action.u.addba_req))) +break ; +ieee80211_sta_process_addba_request (dev, mgmt, len); +break ; +default : +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: received unsupported BACK\n" , + dev->name); +break ; + } +break ; +default : +break ; + } +}void ieee80211_sta_rx_mgmt (struct net_device *dev,struct sk_buff *skb,struct ieee80211_rx_status *rx_status)@@ -1893,6 +2013,7 @@ void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb,case IEEE80211_STYPE_REASSOC_RESP :case IEEE80211_STYPE_DEAUTH :case IEEE80211_STYPE_DISASSOC : +case IEEE80211_STYPE_ACTION :skb_queue_tail (&ifsta->skb_queue, skb);queue_work (local->hw.workqueue, &ifsta->work);return ;@@ -1950,6 +2071,9 @@ static void ieee80211_sta_rx_queued_mgmt(struct net_device *dev,case IEEE80211_STYPE_DISASSOC :ieee80211_rx_mgmt_disassoc (dev, ifsta, mgmt, skb->len);break ; +case IEEE80211_STYPE_ACTION : +ieee80211_rx_mgmt_action (dev, ifsta, mgmt, skb->len); +break ; }kfree_skb (skb);
Re: [PATCH 05/15] mac80211: adding 802.11n essential A-MPDU addBA capability
Quoted 9 lines
Quoted 5 lines
As this series of patches only adds HT handling with no aggregations, (A-MPDU aggregations acceptance is not obligatory according to 802.11n draft) we are currently sending back a refusal upon this request.
Signed-off-by Ron Rindjunsky <[email protected]>Acked-by Johannes Berg <[email protected]>Do you have a plan already on how to fill in that TODO? Just curious.
yep, this TODO is in the top of my list now, and i will send it over as soon as it will start to get a decent shape :)
PATCH 6/15 mac80211: adding 802.11n essential A-MSDU Rx capability
In reply to Ron RindjunskyThis patch adds the ability to receive and handle A-MSDU frames.
--- net/mac80211/ieee80211_i.h | 1 + net/mac80211/rx.c | 124 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+), 0 deletions(-)
net/mac80211/ieee80211_i.h +1 -0
@@ -155,6 +155,7 @@ struct ieee80211_txrx_data {int load;u32 tkip_iv32;u16 tkip_iv16; +u8 amsdu_frame; } rx; } u; };
net/mac80211/rx.c +124 -0
142 lines not on this page · raw message
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 06/15] mac80211: adding 802.11n essential A-MSDU Rx capability
Quoted 3 lines · Ron Rindjunsky
This patch adds the ability to receive and handle A-MSDU frames.
Signed-off-by Ron Rindjunsky <[email protected]>
Thanks for your patience on this. I have another question that is identical in the other code and that we should, if necessary, fix in a separate patch to fix both instances of this:
Quoted 4 lines
net/mac80211/rx.c +4
-0+ payload = frame->data; + ethertype = (payload[6 ] <<8 ) | payload[7 ]; + + if (likely((compare_ether_addr(payload, rfc1042_header) == 0 &&
[...]
net/mac80211/rx.c ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) · line 1306
Quoted 5 lines
net/mac80211/rx.c +5
-0+ }else { +memcpy (skb_push (frame,sizeof (__be16)), &len, +sizeof (__be16)); +memcpy (skb_push (frame,ETH_ALEN ), src,ETH_ALEN ); +memcpy (skb_push (frame,ETH_ALEN ), dst,ETH_ALEN );
Here, as well as in the regular data frame handler, we push the length of the frame into the ethernet header. Later then, eth_type_trans() will load up the skb->protocol field. The thing I'm not entirely sure about is this: We can have frames longer than 1536 bytes, but only if the length is smaller than 1536 does eth_type_trans() assume that it's a length, if we have a frame longer won't it go wrong? I haven't quite managed to wrap my head around the rules for wrapping data into an 802.11 frame nor in an 802.3 setting so this may be totally incorrect.
johannes
Re: [PATCH 06/15] mac80211: adding 802.11n essential A-MSDU Rx capability
Quoted 24 lines · Johannes Berg
Quoted 3 lines · Ron Rindjunsky
This patch adds the ability to receive and handle A-MSDU frames.
Signed-off-by Ron Rindjunsky <[email protected]>Acked-by Johannes Berg <[email protected]>Thanks for your patience on this. I have another question that is identical in the other code and that we should, if necessary, fix in a separate patch to fix both instances of this:
Quoted 4 lines
net/mac80211/rx.c +4
-0+ payload = frame->data; + ethertype = (payload[6 ] <<8 ) | payload[7 ]; + + if (likely((compare_ether_addr(payload, rfc1042_header) == 0 &&[...]
net/mac80211/rx.c ieee80211_deliver_skb(struct ieee80211_txrx_data *rx) · line 1306
Quoted 5 lines
net/mac80211/rx.c +5
-0+ }else { +memcpy (skb_push (frame,sizeof (__be16)), &len, +sizeof (__be16)); +memcpy (skb_push (frame,ETH_ALEN ), src,ETH_ALEN ); +memcpy (skb_push (frame,ETH_ALEN ), dst,ETH_ALEN );
Quoted 9 lines
Here, as well as in the regular data frame handler, we push the length of the frame into the ethernet header. Later then,
eth_type_trans()will load up theskb->protocolfield. The thing I'm not entirely sure about is this: We can have frames longer than 1536 bytes, but only if the length is smaller than 1536 doeseth_type_trans()assume that it's a length, if we have a frame longer won't it go wrong? I haven't quite managed to wrap my head around the rules for wrapping data into an 802.11 frame nor in an 802.3 setting so this may be totally incorrect.
Just grabbed this from wikipedia
'
values of that field between 0 and 1500 indicated the use of the original 802.3 Ethernet format with a length field, while values of 1536 decimal (0600 hexadecimal) and greater indicated the use of the DIX frame format with an EtherType sub-protocol identifier '
Quoted 2 lines
johannes
Re: [PATCH 06/15] mac80211: adding 802.11n essential A-MSDU Rx capability
In reply to Ron Rindjunskynet/mac80211/ieee80211_i.h struct ieee80211_txrx_data { · line 158
Quoted 9 lines · On Monday 26 November 2007 09:14:33 Ron Rindjunsky wrote:
net/mac80211/ieee80211_i.h +1
-0@@ -155,6 +155,7 @@ struct ieee80211_txrx_data {int load;u32 tkip_iv32;u16 tkip_iv16; +u8 amsdu_frame;
A flag would be preferable.
-Michael Wu
Re: [PATCH 06/15] mac80211: adding 802.11n essential A-MSDU Rx capability
Quoted 11 lines
net/mac80211/ieee80211_i.h struct ieee80211_txrx_data { · line 158
Quoted 9 lines
net/mac80211/ieee80211_i.h +1
-0@@ -155,6 +155,7 @@ struct ieee80211_txrx_data {int load;u32 tkip_iv32;u16 tkip_iv16; +u8 amsdu_frame;A flag would be preferable.
I agree, will be more efficient.
If no one has a solid objection for altering the variable to a flag I will issue a patch on top of this patch that will do it.
Quoted 3 lines
-Michael Wu
PATCH 7/15 mac80211: adding 802.11n configuration flows
In reply to Ron RindjunskyThis patch configures the 802.11n mode of operation internally in ieee80211_conf structure and in the low-level driver as well (through op conf_ht).
It does not include AP configuration flows.
--- include/net/mac80211.h | 3 ++ net/mac80211/ieee80211.c | 51 ++++++++++++++++++++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 3 ++ net/mac80211/ieee80211_sta.c | 32 ++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 0 deletions(-)
include/net/mac80211.h +3 -0
@@ -1040,6 +1040,8 @@ enum ieee80211_erp_change_flags {* @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. * This is needed only for IBSS mode and the result of this function is * used to determine whether to reply to Probe Requests. +* +* @conf_ht: Configures low level driver with 802.11n HT data. Must be atomic. */ struct ieee80211_ops { int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1085,6 +1087,7 @@ struct ieee80211_ops {struct sk_buff *skb, struct ieee80211_tx_control *control);int (*tx_last_beacon)(struct ieee80211_hw *hw); +int (*conf_ht)(struct ieee80211_hw *hw,struct ieee80211_conf *conf); };/**
net/mac80211/ieee80211.c +51 -0
63 lines not on this page · raw message
net/mac80211/ieee80211_i.h +3 -0
@@ -711,6 +711,9 @@ int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr);void ieee80211_if_setup (struct net_device *dev);struct ieee80211_rate *ieee80211_get_rate (struct ieee80211_local *local,int phymode,int hwrate); +int ieee80211_hw_config_ht (struct ieee80211_local *local,int enable_ht, +struct ieee80211_ht_info *req_ht_cap, +struct ieee80211_ht_bss_info *req_bss_cap);/* ieee80211_ioctl.c */ extern const struct iw_handler_def ieee80211_iw_handler_def;
net/mac80211/ieee80211_sta.c +32 -0
@@ -1441,6 +1441,19 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev, } sta->supp_rates = rates; +if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param && + local->ops->conf_ht) { +struct ieee80211_ht_bss_info bss_info; + +ieee80211_ht_cap_ie_to_ht_info ( + (struct ieee80211_ht_cap *) + elems.ht_cap_elem, &sta->ht_info); +ieee80211_ht_addt_info_ie_to_ht_bss_info ( + (struct ieee80211_ht_addt_info *) + elems.ht_info_elem, &bss_info); +ieee80211_hw_config_ht (local,1 , &sta->ht_info, &bss_info); + } +rate_control_rate_init (sta, local);if (elems.wmm_param && (ifsta->flags &IEEE80211_STA_WMM_ENABLED )) {
@@ -1853,6 +1866,8 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,struct ieee80211_if_sta *ifsta;size_t baselen;struct ieee802_11_elems elems; +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct ieee80211_conf *conf = &local->hw.conf;ieee80211_rx_bss_info (dev, mgmt, len, rx_status,1 );
@@ -1875,6 +1890,23 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,if (elems.erp_info && elems.erp_info_len >=1 )ieee80211_handle_erp_ie (dev, elems.erp_info[0 ]); +if (elems.ht_cap_elem && elems.ht_info_elem && + elems.wmm_param && local->ops->conf_ht && + conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) { +struct ieee80211_ht_bss_info bss_info; + +ieee80211_ht_addt_info_ie_to_ht_bss_info ( + (struct ieee80211_ht_addt_info *) + elems.ht_info_elem, &bss_info); +/* check if AP changed bss inforamation */ +if ((conf->ht_bss_conf.primary_channel != + bss_info.primary_channel) || + (conf->ht_bss_conf.bss_cap != bss_info.bss_cap) || + (conf->ht_bss_conf.bss_op_mode != bss_info.bss_op_mode)) +ieee80211_hw_config_ht (local,1 , &conf->ht_conf, + &bss_info); + } +if (elems.wmm_param && (ifsta->flags &IEEE80211_STA_WMM_ENABLED )) {ieee80211_sta_wmm_params (dev, ifsta, elems.wmm_param, elems.wmm_param_len);
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Re: [PATCH 07/15] mac80211: adding 802.11n configuration flows
Quoted 6 lines · Ron Rindjunsky
This patch configures the 802.11n mode of operation internally in
ieee80211_confstructure and in the low-level driver as well (through opconf_ht).
It does not include AP configuration flows.Signed-off-by Ron Rindjunsky <[email protected]>
I look forward to seeing your bss config patches again :)
Quoted 168 lines
--- include/net/mac80211.h | 3 ++ net/mac80211/ieee80211.c | 51 ++++++++++++++++++++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 3 ++ net/mac80211/ieee80211_sta.c | 32 ++++++++++++++++++++++++++ 4 files changed, 89 insertions(+), 0 deletions(-)include/net/mac80211.h +3
-0@@ -1040,6 +1040,8 @@ enum ieee80211_erp_change_flags {* @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. * This is needed only for IBSS mode and the result of this function is * used to determine whether to reply to Probe Requests. +* +* @conf_ht: Configures low level driver with 802.11n HT data. Must be atomic. */ struct ieee80211_ops { int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,@@ -1085,6 +1087,7 @@ struct ieee80211_ops {struct sk_buff *skb, struct ieee80211_tx_control *control);int (*tx_last_beacon)(struct ieee80211_hw *hw); +int (*conf_ht)(struct ieee80211_hw *hw,struct ieee80211_conf *conf); };/** net/mac80211/ieee80211.c +51
-0@@ -34,6 +34,8 @@#include "debugfs.h" #include "debugfs_netdev.h" +#define SUPP_MCS_SET_LEN 16 +/* * For seeing transmitted packets on monitor interfaces * we have a radiotap header too. @@ -557,6 +559,55 @@ int ieee80211_hw_config(struct ieee80211_local *local)return ret; } +/** +* ieee80211_hw_config_ht should be used only after legacy configuration +* has been determined, as ht configuration depends upon the hardware's +* HT abilities for a _specific_ band. +*/ +int ieee80211_hw_config_ht (struct ieee80211_local *local,int enable_ht, +struct ieee80211_ht_info *req_ht_cap, +struct ieee80211_ht_bss_info *req_bss_cap) +{ +struct ieee80211_conf *conf = &local->hw.conf; +struct ieee80211_hw_mode *mode = conf->mode; +int i; + +/* HT is not supported */ +if (!mode->ht_info.ht_supported) { + conf->flags &= ~IEEE80211_CONF_SUPPORT_HT_MODE ; +return -EOPNOTSUPP ; + } + +/* disable HT */ +if (!enable_ht) { + conf->flags &= ~IEEE80211_CONF_SUPPORT_HT_MODE ; + }else { + conf->flags |=IEEE80211_CONF_SUPPORT_HT_MODE ; + conf->ht_conf.cap = req_ht_cap->cap & mode->ht_info.cap; + conf->ht_conf.cap &= ~(IEEE80211_HT_CAP_MIMO_PS ); + conf->ht_conf.cap |= + mode->ht_info.cap &IEEE80211_HT_CAP_MIMO_PS ; + conf->ht_bss_conf.primary_channel = + req_bss_cap->primary_channel; + conf->ht_bss_conf.bss_cap = req_bss_cap->bss_cap; + conf->ht_bss_conf.bss_op_mode = req_bss_cap->bss_op_mode; +for (i =0 ; i <SUPP_MCS_SET_LEN ; i++) + conf->ht_conf.supp_mcs_set[i] = + mode->ht_info.supp_mcs_set[i] & + req_ht_cap->supp_mcs_set[i]; + +/* In STA mode, this gives us indication +* to the AP's mode of operation */ + conf->ht_conf.ht_supported =1 ; + conf->ht_conf.ampdu_factor = req_ht_cap->ampdu_factor; + conf->ht_conf.ampdu_density = req_ht_cap->ampdu_density; + } + + local->ops->conf_ht (local_to_hw (local), &local->hw.conf); + +return 0 ; +} +void ieee80211_erp_info_change_notify (struct net_device *dev,u8 changes) {struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr);net/mac80211/ieee80211_i.h +3
-0@@ -711,6 +711,9 @@ int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr);void ieee80211_if_setup (struct net_device *dev);struct ieee80211_rate *ieee80211_get_rate (struct ieee80211_local *local,int phymode,int hwrate); +int ieee80211_hw_config_ht (struct ieee80211_local *local,int enable_ht, +struct ieee80211_ht_info *req_ht_cap, +struct ieee80211_ht_bss_info *req_bss_cap);/* ieee80211_ioctl.c */ extern const struct iw_handler_def ieee80211_iw_handler_def;net/mac80211/ieee80211_sta.c +32
-0@@ -1441,6 +1441,19 @@ static void ieee80211_rx_mgmt_assoc_resp(struct net_device *dev, } sta->supp_rates = rates; +if (elems.ht_cap_elem && elems.ht_info_elem && elems.wmm_param && + local->ops->conf_ht) { +struct ieee80211_ht_bss_info bss_info; + +ieee80211_ht_cap_ie_to_ht_info ( + (struct ieee80211_ht_cap *) + elems.ht_cap_elem, &sta->ht_info); +ieee80211_ht_addt_info_ie_to_ht_bss_info ( + (struct ieee80211_ht_addt_info *) + elems.ht_info_elem, &bss_info); +ieee80211_hw_config_ht (local,1 , &sta->ht_info, &bss_info); + } +rate_control_rate_init (sta, local);if (elems.wmm_param && (ifsta->flags &IEEE80211_STA_WMM_ENABLED )) {@@ -1853,6 +1866,8 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,struct ieee80211_if_sta *ifsta;size_t baselen;struct ieee802_11_elems elems; +struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct ieee80211_conf *conf = &local->hw.conf;ieee80211_rx_bss_info (dev, mgmt, len, rx_status,1 );@@ -1875,6 +1890,23 @@ static void ieee80211_rx_mgmt_beacon(struct net_device *dev,if (elems.erp_info && elems.erp_info_len >=1 )ieee80211_handle_erp_ie (dev, elems.erp_info[0 ]); +if (elems.ht_cap_elem && elems.ht_info_elem && + elems.wmm_param && local->ops->conf_ht && + conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) { +struct ieee80211_ht_bss_info bss_info; + +ieee80211_ht_addt_info_ie_to_ht_bss_info ( + (struct ieee80211_ht_addt_info *) + elems.ht_info_elem, &bss_info); +/* check if AP changed bss inforamation */ +if ((conf->ht_bss_conf.primary_channel != + bss_info.primary_channel) || + (conf->ht_bss_conf.bss_cap != bss_info.bss_cap) || + (conf->ht_bss_conf.bss_op_mode != bss_info.bss_op_mode)) +ieee80211_hw_config_ht (local,1 , &conf->ht_conf, + &bss_info); + } +if (elems.wmm_param && (ifsta->flags &IEEE80211_STA_WMM_ENABLED )) {ieee80211_sta_wmm_params (dev, ifsta, elems.wmm_param, elems.wmm_param_len);
Re: [PATCH 07/15] mac80211: adding 802.11n configuration flows
Quoted 10 lines
Quoted 6 lines
This patch configures the 802.11n mode of operation internally in
ieee80211_confstructure and in the low-level driver as well (through opconf_ht).
It does not include AP configuration flows.Signed-off-by Ron Rindjunsky <[email protected]>Acked-by Johannes Berg <[email protected]>I look forward to seeing your bss config patches again :)
I also see them as important to the configuration flow efficiancy, and will treat them accordingly.
PATCH 8/15 iwlwifi: 802.11n remove unnecessary config dependency
In reply to Ron RindjunskyThis patch removes MAC80211_HT config dependency as it has been eliminated in mac80211, and adds a needed QoS dependency
--- drivers/net/wireless/iwlwifi/Kconfig | 16 ++++++++-------- 1 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/wireless/iwlwifi/Kconfig +8 -8
@@ -33,6 +33,14 @@ config IWL4965_QOS This option will enable wireless quality of service (QoS) for the iw4965 driver. +config IWL4965_HT + bool "Enable 802.11n HT features in iwl4965 driver" + depends on EXPERIMENTAL + depends on IWL4965 && IWL4965_QOS + ---help--- + This option enables IEEE 802.11n High Throughput features + for the iwl4965 driver. + config IWL4965_SPECTRUM_MEASUREMENT bool "Enable Spectrum Measurement in iw4965 driver" depends on IWL4965
@@ -46,14 +54,6 @@ config IWL4965_SENSITIVITY This option will enable sensitivity calibration for the iwl4965 driver. -config IWL4965_HT - bool "Enable 802.11n HT features in iwl4965 driver" - depends on EXPERIMENTAL - depends on IWL4965 && MAC80211_HT - ---help--- - This option enables IEEE 802.11n High Throughput features - for the iwl4965 driver. - config IWL4965_DEBUG bool "Enable full debugging output in iwl4965 driver" depends on IWL4965
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 9/15 iwlwifi: 802.11n new framework structures preperation
In reply to Ron RindjunskyThis patch removes unnecessary or duplicate 802.11n data from structures in the code, and prepares them for new mac80211's 802.11n framework
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 2 +- drivers/net/wireless/iwlwifi/iwl-4965.h | 27 +++++++++++---------------- drivers/net/wireless/iwlwifi/iwl4965-base.c | 2 -- 3 files changed, 12 insertions(+), 19 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +1 -1
@@ -1827,7 +1827,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,if (local->hw.conf.phymode ==MODE_IEEE80211A ) sta->last_txrate +=IWL_FIRST_OFDM_RATE ; - crl->is_dup = priv->is_dup; + crl->is_dup =0 ; crl->valid_antenna = priv->valid_antenna; crl->antenna = priv->antenna; crl->is_green =rs_use_green (priv);
drivers/net/wireless/iwlwifi/iwl-4965.h +11 -16
@@ -477,22 +477,23 @@ union iwl4965_ht_rate_supp {#define CFG_HT_MPDU_DENSITY_2USEC (0x5)#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC -struct sta_ht_info { +struct iwl_ht_info { +/* self configuration data */ u8 is_ht; -u16 rx_mimo_ps_mode; +u8 supported_chan_width;u16 tx_mimo_ps_mode; -u16 control_channel; +u8 is_green_field; +u8 sgf;u8 max_amsdu_size;u8 ampdu_factor;u8 mpdu_density; -u8 operating_mode; -u8 supported_chan_width; +u8 supp_mcs_set[16 ]; +/* BSS related data */ +u8 control_channel;u8 extension_chan_offset; -u8 is_green_field; -u8 sgf; -u8 supp_rates[16 ];u8 tx_chan_width; -u8 chan_width_cap; +u8 ht_protection; +u8 non_GF_STA_present; };#endif /*CONFIG_IWL4965_HT */
@@ -1149,11 +1150,6 @@ struct iwl4965_priv {u8 call_post_assoc_from_beacon;u8 assoc_station_added;u8 use_ant_b_for_management_frame;/* Tx antenna selection */ -/* HT variables */ -u8 is_dup; -u8 is_ht_enabled; -u8 channel_width;/* 0=20MHZ, 1=40MHZ */ -u8 current_channel_width;u8 valid_antenna;/* Bit mask of antennas actually connected */ #ifdef CONFIG_IWL4965_SENSITIVITY struct iwl4965_sensitivity_data sensitivity_data;
@@ -1163,9 +1159,8 @@ struct iwl4965_priv {#endif /*CONFIG_IWL4965_SENSITIVITY*/ #ifdef CONFIG_IWL4965_HT -struct sta_ht_info current_assoc_ht; +struct iwl_ht_info current_ht_config;#endif -u8 active_rate_ht[2 ];u8 last_phy_res[100 ];/* Rate scaling data */
drivers/net/wireless/iwlwifi/iwl4965-base.c +0 -2
@@ -9068,8 +9068,6 @@ static int iwl4965_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e priv->ps_mode =0 ; priv->use_ant_b_for_management_frame =1 ;/* start with ant B */ - priv->is_ht_enabled =1 ; - priv->channel_width =IWL_CHANNEL_WIDTH_40MHZ ; priv->valid_antenna =0x7 ;/* assume all 3 connected */ priv->ps_mode =IWL_MIMO_PS_NONE ;
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 10/15 iwlwifi: 802.11n configuring hw_mode parameters to support HT in A/G
In reply to Ron RindjunskyThis patch fills the mac80211's ieee80211_hw_mode structures with the needed 802.11n data needed for the new framework
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 24 ++++++++++++++++++++++++ drivers/net/wireless/iwlwifi/iwl-4965.h | 2 ++ drivers/net/wireless/iwlwifi/iwl4965-base.c | 24 +++++++----------------- 3 files changed, 33 insertions(+), 17 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +24 -0
@@ -3668,6 +3668,30 @@ static int parse_elems(u8 *start, size_t len, struct ieee802_11_elems *elems)return 0 ; } + +void iwl4965_init_ht_hw_capab (struct ieee80211_ht_info *ht_info,int mode) +{ + ht_info->cap =0 ; +memset (ht_info->supp_mcs_set,0 ,16 ); + + ht_info->ht_supported =1 ; + +if (mode ==MODE_IEEE80211A ) { + ht_info->cap |= (u16 )IEEE80211_HT_CAP_SUP_WIDTH ; + ht_info->cap |= (u16 )IEEE80211_HT_CAP_SGI_40 ; + ht_info->supp_mcs_set[4 ] =0x01 ; + } + ht_info->cap |= (u16 )IEEE80211_HT_CAP_GRN_FLD ; + ht_info->cap |= (u16 )IEEE80211_HT_CAP_SGI_20 ; + ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS & + (IWL_MIMO_PS_NONE <<2 )); + + ht_info->ampdu_factor =CFG_HT_RX_AMPDU_FACTOR_DEF ; + ht_info->ampdu_density =CFG_HT_MPDU_DENSITY_DEF ; + + ht_info->supp_mcs_set[0 ] =0xFF ; + ht_info->supp_mcs_set[1 ] =0xFF ; +}#endif /* CONFIG_IWL4965_HT */ static void iwl4965_sta_modify_ps_wake (struct iwl4965_priv *priv,int sta_id)
drivers/net/wireless/iwlwifi/iwl-4965.h +2 -0
@@ -764,6 +764,8 @@ extern int iwl4965_set_fat_chan_info(struct iwl4965_priv *priv, int phymode,extern void iwl4965_rf_kill_ct_config (struct iwl4965_priv *priv);#ifdef CONFIG_IWL4965_HT +extern void iwl4965_init_ht_hw_capab (struct ieee80211_ht_info *ht_info, +int mode);#ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start (struct ieee80211_hw *hw,u8 *da,u16 tid,u16 *start_seq_num);
drivers/net/wireless/iwlwifi/iwl4965-base.c +7 -17
@@ -5644,10 +5644,8 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)A =0 ,B =1 , G = 2, -A_11N =3 , - G_11N = 4, }; -int mode_count =5 ; +int mode_count =3 ;if (priv->modes) {IWL_DEBUG_INFO ("Geography modes already initialized.\n" );
@@ -5687,6 +5685,9 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv) modes[A ].num_rates =8 ;/* just OFDM */ modes[A ].rates = &rates[4 ]; modes[A ].num_channels =0 ; +#ifdef CONFIG_IWL4965_HT +iwl4965_init_ht_hw_capab (&modes[A ].ht_info,MODE_IEEE80211A ); +#endif modes[B ].mode =MODE_IEEE80211B ; modes[B ].channels = channels;
@@ -5699,18 +5700,9 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv) modes[G ].rates = rates; modes[G ].num_rates =12 ;/* OFDM & CCK */ modes[G ].num_channels =0 ; - - modes[G_11N ].mode =MODE_IEEE80211G ; - modes[G_11N ].channels = channels; - modes[G_11N ].num_rates =13 ;/* OFDM & CCK */ - modes[G_11N ].rates = rates; - modes[G_11N ].num_channels =0 ; - - modes[A_11N ].mode =MODE_IEEE80211A ; - modes[A_11N ].channels = &channels[ARRAY_SIZE (iwl4965_eeprom_band_1)]; - modes[A_11N ].rates = &rates[4 ]; - modes[A_11N ].num_rates =9 ;/* just OFDM */ - modes[A_11N ].num_channels =0 ; +#ifdef CONFIG_IWL4965_HT +iwl4965_init_ht_hw_capab (&modes[G ].ht_info,MODE_IEEE80211G ); +#endif priv->ieee_channels = channels; priv->ieee_rates = rates;
@@ -5730,11 +5722,9 @@ static int iwl4965_init_geos(struct iwl4965_priv *priv)if (is_channel_a_band (ch)) { geo_ch = &modes[A ].channels[modes[A ].num_channels++]; - modes[A_11N ].num_channels++; }else { geo_ch = &modes[B ].channels[modes[B ].num_channels++]; modes[G ].num_channels++; - modes[G_11N ].num_channels++; } geo_ch->freq =ieee80211chan2mhz (ch->channel);
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 11/15 iwlwifi: 802.11n handling probe request HT IE
In reply to Ron RindjunskyThis patch conforms the probe request's HT IE with the new structures used in iwlwifi HT.
--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 62 ++++++++++++--------------- 1 files changed, 28 insertions(+), 34 deletions(-)
drivers/net/wireless/iwlwifi/iwl4965-base.c +28 -34
@@ -1820,8 +1820,8 @@ static u16 iwl4965_supported_rate_to_ie(u8 *ie, u16 supported_rate,#ifdef CONFIG_IWL4965_HT void static iwl4965_set_ht_capab (struct ieee80211_hw *hw, -struct ieee80211_ht_capability *ht_cap, -u8 use_wide_chan); +struct ieee80211_ht_cap *ht_cap, +u8 use_current_config);#endif /**
@@ -1834,6 +1834,9 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv,int len =0 ;u8 *pos =NULL ;u16 active_rates, ret_rates, cck_rates, active_rate_basic; +#ifdef CONFIG_IWL4965_HT +struct ieee80211_hw_mode *mode; +#endif /* CONFIG_IWL4965_HT */ /* Make sure there is enough space for the probe request, * two mandatory IEs and the data */
@@ -1917,17 +1920,14 @@ static u16 iwl4965_fill_probe_req(struct iwl4965_priv *priv, len +=2 + *pos;#ifdef CONFIG_IWL4965_HT -if (is_direct && priv->is_ht_enabled) { -u8 use_wide_chan =1 ; - -if (priv->channel_width !=IWL_CHANNEL_WIDTH_40MHZ ) - use_wide_chan =0 ; + mode = priv->hw->conf.mode; +if (mode->ht_info.ht_supported) { pos += (*pos) +1 ; *pos++ =WLAN_EID_HT_CAPABILITY ; - *pos++ =sizeof (struct ieee80211_ht_capability ); -iwl4965_set_ht_capab (NULL , (struct ieee80211_ht_capability *)pos, - use_wide_chan); - len +=2 +sizeof (struct ieee80211_ht_capability ); + *pos++ =sizeof (struct ieee80211_ht_cap ); +iwl4965_set_ht_capab (priv->hw, + (struct ieee80211_ht_cap *)pos,0 ); + len +=2 +sizeof (struct ieee80211_ht_cap ); }#endif /*CONFIG_IWL4965_HT */
@@ -8160,31 +8160,25 @@ static int iwl4965_mac_conf_ht(struct ieee80211_hw *hw, }static void iwl4965_set_ht_capab (struct ieee80211_hw *hw, -struct ieee80211_ht_capability *ht_cap, -u8 use_wide_chan) +struct ieee80211_ht_cap *ht_cap, +u8 use_current_config) { -union ht_cap_info cap; -union ht_param_info param_info; +struct ieee80211_conf *conf = &hw->conf; +struct ieee80211_hw_mode *mode = conf->mode; -memset (&cap,0 ,sizeof (union ht_cap_info )); -memset (¶m_info,0 ,sizeof (union ht_param_info )); - - cap.maximal_amsdu_size =HT_IE_MAX_AMSDU_SIZE_4K ; - cap.green_field =1 ; - cap.short_GI20 =1 ; - cap.short_GI40 =1 ; - cap.supported_chan_width_set = use_wide_chan; - cap.mimo_power_save_mode =0x3 ; - - param_info.max_rx_ampdu_factor =CFG_HT_RX_AMPDU_FACTOR_DEF ; - param_info.mpdu_density =CFG_HT_MPDU_DENSITY_DEF ; - ht_cap->capabilities_info = (__le16 )cpu_to_le16 (cap.val); - ht_cap->mac_ht_params_info = (u8 ) param_info.val; - - ht_cap->supported_mcs_set[0 ] =0xff ; - ht_cap->supported_mcs_set[1 ] =0xff ; - ht_cap->supported_mcs_set[4 ] = - (cap.supported_chan_width_set) ?0x1 :0x0 ; +if (use_current_config) { + ht_cap->cap_info =cpu_to_le16 (conf->ht_conf.cap); +memcpy (ht_cap->supp_mcs_set, + conf->ht_conf.supp_mcs_set,16 ); + }else { + ht_cap->cap_info =cpu_to_le16 (mode->ht_info.cap); +memcpy (ht_cap->supp_mcs_set, + mode->ht_info.supp_mcs_set,16 ); + } + ht_cap->ampdu_params_info = + (mode->ht_info.ampdu_factor &IEEE80211_HT_CAP_AMPDU_FACTOR ) | + ((mode->ht_info.ampdu_density <<2 ) & +IEEE80211_HT_CAP_AMPDU_DENSITY ); } static void iwl4965_mac_get_ht_capab(struct ieee80211_hw *hw,
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 12/15 iwlwifi: 802.11n comply HT self configuration flow with mac80211 framework
In reply to Ron RindjunskyThis patch conforms HW configuration changes according to new mac80211's HT framework
--- drivers/net/wireless/iwlwifi/iwl-4965.c | 40 +++--- drivers/net/wireless/iwlwifi/iwl-4965.h | 6 +- drivers/net/wireless/iwlwifi/iwl4965-base.c | 186 +++++++-------------------- 3 files changed, 66 insertions(+), 166 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965.c +19 -21
@@ -87,8 +87,8 @@ static int is_fat_channel(__le32 rxon_flags)static u8 is_single_stream (struct iwl4965_priv *priv) {#ifdef CONFIG_IWL4965_HT -if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht || - (priv->active_rate_ht[1 ] ==0 ) || +if (!priv->current_ht_config.is_ht || + (priv->current_ht_config.supp_mcs_set[1 ] ==0 ) || (priv->ps_mode ==IWL_MIMO_PS_STATIC ))return 1 ;#else
@@ -4369,27 +4369,27 @@ static u8 iwl4965_is_channel_extension(struct iwl4965_priv *priv, int phymode, }static u8 iwl4965_is_fat_tx_allowed (struct iwl4965_priv *priv, -const struct sta_ht_info *ht_info) +struct ieee80211_ht_info *sta_ht_inf) { +struct iwl_ht_info *iwl_ht_conf = &priv->current_ht_config; -if (priv->channel_width !=IWL_CHANNEL_WIDTH_40MHZ ) +if ((!iwl_ht_conf->is_ht) || + (iwl_ht_conf->supported_chan_width !=IWL_CHANNEL_WIDTH_40MHZ ) || + (iwl_ht_conf->extension_chan_offset ==IWL_EXT_CHANNEL_OFFSET_AUTO ))return 0 ; -if (ht_info->supported_chan_width !=IWL_CHANNEL_WIDTH_40MHZ ) -return 0 ; - -if (ht_info->extension_chan_offset ==IWL_EXT_CHANNEL_OFFSET_AUTO ) -return 0 ; +if (sta_ht_inf) { +if ((!sta_ht_inf->ht_supported) || + (!sta_ht_inf->cap &IEEE80211_HT_CAP_SUP_WIDTH )) +return 0 ; + } -/* no fat tx allowed on 2.4GHZ */ -if (priv->phymode !=MODE_IEEE80211A ) -return 0 ;return (iwl4965_is_channel_extension (priv, priv->phymode, - ht_info->control_channel, - ht_info->extension_chan_offset)); + iwl_ht_conf->control_channel, + iwl_ht_conf->extension_chan_offset)); } -void iwl4965_set_rxon_ht (struct iwl4965_priv *priv,struct sta_ht_info *ht_info) +void iwl4965_set_rxon_ht (struct iwl4965_priv *priv,struct iwl_ht_info *ht_info) {struct iwl4965_rxon_cmd *rxon = &priv->staging_rxon;u32 val;
@@ -4397,7 +4397,7 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info)if (!ht_info->is_ht)return ; -if (iwl4965_is_fat_tx_allowed (priv, ht_info)) +if (iwl4965_is_fat_tx_allowed (priv,NULL )) rxon->flags |=RXON_FLG_CHANNEL_MODE_MIXED_MSK ;else rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED_MSK |
@@ -4427,20 +4427,18 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct sta_ht_info *ht_info)break ; } - val = ht_info->operating_mode; + val = ht_info->ht_protection; rxon->flags |=cpu_to_le32 (val <<RXON_FLG_HT_OPERATING_MODE_POS ); - priv->active_rate_ht[0 ] = ht_info->supp_rates[0 ]; - priv->active_rate_ht[1 ] = ht_info->supp_rates[1 ];iwl4965_set_rxon_chain (priv);IWL_DEBUG_ASSOC ("supported HT rate 0x%X %X " "rxon flags 0x%X operation mode :0x%X " "extension channel offset 0x%x " "control chan %d\n" , - priv->active_rate_ht[0 ], priv->active_rate_ht[1 ], -le32_to_cpu (rxon->flags), ht_info->operating_mode, + ht_info->supp_mcs_set[0 ], ht_info->supp_mcs_set[1 ], +le32_to_cpu (rxon->flags), ht_info->ht_protection, ht_info->extension_chan_offset, ht_info->control_channel);return ;
drivers/net/wireless/iwlwifi/iwl-4965.h +2 -4
@@ -729,7 +729,6 @@ extern int iwl4965_hw_channel_switch(struct iwl4965_priv *priv, u16 channel);extern int iwl4965_tx_queue_reclaim (struct iwl4965_priv *priv,int txq_id,int index);struct iwl4965_priv ; -struct sta_ht_info ;/* * Forward declare iwl-4965.c functions for iwl-base.c
@@ -742,9 +741,6 @@ extern int iwl4965_tx_queue_update_wr_ptr(struct iwl4965_priv *priv, u16 byte_cnt);extern void iwl4965_add_station (struct iwl4965_priv *priv,const u8 *addr,int is_ap); -extern void iwl4965_set_rxon_ht (struct iwl4965_priv *priv, -struct sta_ht_info *ht_info); -extern void iwl4965_set_rxon_chain (struct iwl4965_priv *priv); extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd, u8 sta_id, dma_addr_t txcmd_phys,
@@ -766,6 +762,8 @@ extern void iwl4965_rf_kill_ct_config(struct iwl4965_priv *priv);#ifdef CONFIG_IWL4965_HT extern void iwl4965_init_ht_hw_capab (struct ieee80211_ht_info *ht_info,int mode); +extern void iwl4965_set_rxon_ht (struct iwl4965_priv *priv, +struct iwl_ht_info *ht_info);#ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start (struct ieee80211_hw *hw,u8 *da,u16 tid,u16 *start_seq_num);
drivers/net/wireless/iwlwifi/iwl4965-base.c +45 -141
244 lines not on this page · raw message
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 13/15 iwlwifi: 802.11n comply HT add station flow with mac80211 framework
In reply to Ron RindjunskyThis patch conforms the addition of a new station to the iwlwifi station table according to the new mac80211's HT framework
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 8 +++--- drivers/net/wireless/iwlwifi/iwl-4965.c | 28 ++++++++++---------------- drivers/net/wireless/iwlwifi/iwl-4965.h | 8 +++--- drivers/net/wireless/iwlwifi/iwl4965-base.c | 24 +++++++++++++++++++--- 4 files changed, 39 insertions(+), 29 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +4 -4
@@ -1728,8 +1728,8 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,if (sta_id ==IWL_INVALID_STATION ) {IWL_DEBUG_RATE ("LQ: ADD station %s\n" ,print_mac (mac, hdr->addr1)); - sta_id =iwl4965_add_station_flags (priv, - hdr->addr1,0 ,CMD_ASYNC ); + sta_id =iwl4965_add_station_flags (priv, hdr->addr1, +0 ,CMD_ASYNC ,NULL ); }if ((sta_id !=IWL_INVALID_STATION )) { lq->lq.sta_id = sta_id;
@@ -1804,8 +1804,8 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,if (sta_id ==IWL_INVALID_STATION ) {IWL_DEBUG_RATE ("LQ: ADD station %s\n" ,print_mac (mac, sta->addr)); - sta_id =iwl4965_add_station_flags (priv, - sta->addr,0 ,CMD_ASYNC ); + sta_id =iwl4965_add_station_flags (priv, sta->addr, +0 ,CMD_ASYNC ,NULL ); }if ((sta_id !=IWL_INVALID_STATION )) { crl->lq.sta_id = sta_id;
drivers/net/wireless/iwlwifi/iwl-4965.c +11 -17
@@ -4444,39 +4444,33 @@ void iwl4965_set_rxon_ht(struct iwl4965_priv *priv, struct iwl_ht_info *ht_info)return ; } -void iwl4965_set_ht_add_station (struct iwl4965_priv *priv,u8 index) +void iwl4965_set_ht_add_station (struct iwl4965_priv *priv,u8 index, +struct ieee80211_ht_info *sta_ht_inf) {__le32 sta_flags; -struct sta_ht_info *ht_info = &priv->current_assoc_ht; - priv->current_channel_width =IWL_CHANNEL_WIDTH_20MHZ ; -if (!ht_info->is_ht) +if (!sta_ht_inf || !sta_ht_inf->ht_supported) goto done; sta_flags = priv->stations[index].sta.station_flags; -if (ht_info->tx_mimo_ps_mode ==IWL_MIMO_PS_DYNAMIC ) +if (((sta_ht_inf->cap &IEEE80211_HT_CAP_MIMO_PS >>2 )) + ==IWL_MIMO_PS_DYNAMIC ) sta_flags |=STA_FLG_RTS_MIMO_PROT_MSK ;else sta_flags &= ~STA_FLG_RTS_MIMO_PROT_MSK ; sta_flags |=cpu_to_le32 ( - (u32 )ht_info->ampdu_factor <<STA_FLG_MAX_AGG_SIZE_POS ); + (u32 )sta_ht_inf->ampdu_factor <<STA_FLG_MAX_AGG_SIZE_POS ); sta_flags |=cpu_to_le32 ( - (u32 )ht_info->mpdu_density <<STA_FLG_AGG_MPDU_DENSITY_POS ); - - sta_flags &= (~STA_FLG_FAT_EN_MSK ); - ht_info->tx_chan_width =IWL_CHANNEL_WIDTH_20MHZ ; - ht_info->chan_width_cap =IWL_CHANNEL_WIDTH_20MHZ ; + (u32 )sta_ht_inf->ampdu_density <<STA_FLG_AGG_MPDU_DENSITY_POS ); -if (iwl4965_is_fat_tx_allowed (priv, ht_info)) { +if (iwl4965_is_fat_tx_allowed (priv, sta_ht_inf)) sta_flags |=STA_FLG_FAT_EN_MSK ; - ht_info->chan_width_cap =IWL_CHANNEL_WIDTH_40MHZ ; -if (ht_info->supported_chan_width ==IWL_CHANNEL_WIDTH_40MHZ ) - ht_info->tx_chan_width =IWL_CHANNEL_WIDTH_40MHZ ; - } - priv->current_channel_width = ht_info->tx_chan_width; +else + sta_flags &= (~STA_FLG_FAT_EN_MSK ); + priv->stations[index].sta.station_flags = sta_flags; done:return ;
drivers/net/wireless/iwlwifi/iwl-4965.h +4 -4
@@ -612,8 +612,8 @@ struct iwl4965_driver_hw_info {struct iwl4965_addsta_cmd ;extern int iwl4965_send_add_station (struct iwl4965_priv *priv,struct iwl4965_addsta_cmd *sta,u8 flags); -extern u8 iwl4965_add_station_flags (struct iwl4965_priv *priv,const u8 *bssid, -int is_ap,u8 flags); +extern u8 iwl4965_add_station_flags (struct iwl4965_priv *priv,const u8 *addr, +int is_ap,u8 flags,void *ht_data);extern int iwl4965_is_network_packet (struct iwl4965_priv *priv,struct ieee80211_hdr *header);extern int iwl4965_power_init_handle (struct iwl4965_priv *priv);
@@ -748,8 +748,6 @@ extern int iwl4965_tx_cmd(struct iwl4965_priv *priv, struct iwl4965_cmd *out_cmd struct ieee80211_tx_control *ctrl, void *sta_in);extern int iwl4965_alive_notify (struct iwl4965_priv *priv);extern void iwl4965_update_rate_scaling (struct iwl4965_priv *priv,u8 mode); -extern void iwl4965_set_ht_add_station (struct iwl4965_priv *priv,u8 index); -extern void iwl4965_chain_noise_reset (struct iwl4965_priv *priv);extern void iwl4965_init_sensitivity (struct iwl4965_priv *priv,u8 flags,u8 force);
@@ -764,6 +762,8 @@ extern void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, int mode);extern void iwl4965_set_rxon_ht (struct iwl4965_priv *priv,struct iwl_ht_info *ht_info); +extern void iwl4965_set_ht_add_station (struct iwl4965_priv *priv,u8 index, +struct ieee80211_ht_info *sta_ht_inf);#ifdef CONFIG_IWL4965_HT_AGG extern int iwl4965_mac_ht_tx_agg_start (struct ieee80211_hw *hw,u8 *da,u16 tid,u16 *start_seq_num);
drivers/net/wireless/iwlwifi/iwl4965-base.c +20 -4
@@ -455,7 +455,8 @@ static void iwl4965_clear_stations_table(struct iwl4965_priv *priv)spin_unlock_irqrestore (&priv->sta_lock, flags); } -u8 iwl4965_add_station_flags (struct iwl4965_priv *priv,const u8 *addr,int is_ap,u8 flags) +u8 iwl4965_add_station_flags (struct iwl4965_priv *priv,const u8 *addr, +int is_ap,u8 flags,void *ht_data) {int i;int index =IWL_INVALID_STATION ;
@@ -511,7 +512,8 @@ u8 iwl4965_add_station_flags(struct iwl4965_priv *priv, const u8 *addr, int is_a/* BCAST station and IBSS stations do not work in HT mode */ if (index != priv->hw_setting.bcast_sta_id && priv->iw_mode !=IEEE80211_IF_TYPE_IBSS ) -iwl4965_set_ht_add_station (priv, index); +iwl4965_set_ht_add_station (priv, index, + (struct ieee80211_ht_info *) ht_data);#endif /*CONFIG_IWL4965_HT*/ spin_unlock_irqrestore (&priv->sta_lock, flags_spin);
@@ -850,7 +852,20 @@ static int iwl4965_rxon_add_station(struct iwl4965_priv *priv, {u8 sta_id; - sta_id =iwl4965_add_station_flags (priv, addr, is_ap,0 ); +#ifdef CONFIG_IWL4965_HT +struct ieee80211_conf *conf = &priv->hw->conf; +struct ieee80211_ht_info *cur_ht_config = &conf->ht_conf; + +if ((is_ap) && + (conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) && + (priv->iw_mode ==IEEE80211_IF_TYPE_STA )) + sta_id =iwl4965_add_station_flags (priv, addr, is_ap, +0 , cur_ht_config); + else +#endif /* CONFIG_IWL4965_HT */ + sta_id =iwl4965_add_station_flags (priv, addr, is_ap, +0 ,NULL ); +iwl4965_add_station (priv, addr, is_ap);return sta_id;
@@ -2772,7 +2787,8 @@ static int iwl4965_get_sta_id(struct iwl4965_priv *priv, struct ieee80211_hdr *hif (sta_id !=IWL_INVALID_STATION )return sta_id; - sta_id =iwl4965_add_station_flags (priv, hdr->addr1,0 ,CMD_ASYNC ); + sta_id =iwl4965_add_station_flags (priv, hdr->addr1, +0 ,CMD_ASYNC ,NULL );if (sta_id !=IWL_INVALID_STATION )return sta_id;
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 14/15 iwlwifi: 802.11n comply HT rate scaling flows with mac80211 framework
In reply to Ron RindjunskyThis patch conforms the rate scaling flows according to the new mac80211's HT framework
--- drivers/net/wireless/iwlwifi/iwl-4965-rs.c | 93 +++++++++++++++++----------- 1 files changed, 57 insertions(+), 36 deletions(-)
drivers/net/wireless/iwlwifi/iwl-4965-rs.c +57 -36
@@ -440,15 +440,14 @@ static inline void rs_toggle_antenna(struct iwl4965_rate *new_rate, } } -static inline u8 rs_use_green (struct iwl4965_priv *priv) +static inline u8 rs_use_green (struct iwl4965_priv *priv, +struct ieee80211_conf *conf) {#ifdef CONFIG_IWL4965_HT -if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) -return 0 ; - -return ((priv->current_assoc_ht.is_green_field) && - !(priv->current_assoc_ht.operating_mode &0x4 )); -#endif /*CONFIG_IWL4965_HT */ +return ((conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) && + priv->current_ht_config.is_green_field && + !priv->current_ht_config.non_GF_STA_present); +#endif /* CONFIG_IWL4965_HT */ return 0 ; }
@@ -888,6 +887,8 @@ static inline u8 rs_is_both_ant_supp(u8 valid_antenna)static int rs_switch_to_mimo (struct iwl4965_priv *priv,struct iwl4965_rate_scale_priv *lq_data, +struct ieee80211_conf *conf, +struct sta_info *sta,struct iwl4965_scale_tbl_info *tbl,int index) {#ifdef CONFIG_IWL4965_HT
@@ -895,7 +896,8 @@ static int rs_switch_to_mimo(struct iwl4965_priv *priv,s32 rate;s8 is_green = lq_data->is_green; -if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) +if (!(conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) || + !sta->ht_info.ht_supported)return -1 ;IWL_DEBUG_HT ("LQ: try to switch to MIMO\n" );
@@ -903,7 +905,7 @@ static int rs_switch_to_mimo(struct iwl4965_priv *priv,rs_get_supported_rates (lq_data,NULL , tbl->lq_type, &rate_mask); -if (priv->current_assoc_ht.tx_mimo_ps_mode ==IWL_MIMO_PS_STATIC ) +if (priv->current_ht_config.tx_mimo_ps_mode ==IWL_MIMO_PS_STATIC )return -1 ;if (!rs_is_both_ant_supp (lq_data->antenna))
@@ -911,17 +913,18 @@ static int rs_switch_to_mimo(struct iwl4965_priv *priv, tbl->is_dup = lq_data->is_dup; tbl->action =0 ; -if (priv->current_channel_width ==IWL_CHANNEL_WIDTH_40MHZ ) +if (priv->current_ht_config.supported_chan_width + ==IWL_CHANNEL_WIDTH_40MHZ ) tbl->is_fat =1 ;else tbl->is_fat =0 ;if (tbl->is_fat) { -if (priv->current_assoc_ht.sgf &HT_SHORT_GI_40MHZ_ONLY ) +if (priv->current_ht_config.sgf &HT_SHORT_GI_40MHZ_ONLY ) tbl->is_SGI =1 ;else tbl->is_SGI =0 ; - }else if (priv->current_assoc_ht.sgf &HT_SHORT_GI_20MHZ_ONLY ) + }else if (priv->current_ht_config.sgf &HT_SHORT_GI_20MHZ_ONLY ) tbl->is_SGI =1 ;else tbl->is_SGI =0 ;
@@ -945,6 +948,8 @@ static int rs_switch_to_mimo(struct iwl4965_priv *priv,static int rs_switch_to_siso (struct iwl4965_priv *priv,struct iwl4965_rate_scale_priv *lq_data, +struct ieee80211_conf *conf, +struct sta_info *sta,struct iwl4965_scale_tbl_info *tbl,int index) {#ifdef CONFIG_IWL4965_HT
@@ -953,7 +958,8 @@ static int rs_switch_to_siso(struct iwl4965_priv *priv,s32 rate;IWL_DEBUG_HT ("LQ: try to switch to SISO\n" ); -if (!priv->is_ht_enabled || !priv->current_assoc_ht.is_ht) +if (!(conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE ) || + !sta->ht_info.ht_supported)return -1 ; tbl->is_dup = lq_data->is_dup;
@@ -962,17 +968,18 @@ static int rs_switch_to_siso(struct iwl4965_priv *priv,rs_get_supported_rates (lq_data,NULL , tbl->lq_type, &rate_mask); -if (priv->current_channel_width ==IWL_CHANNEL_WIDTH_40MHZ ) +if (priv->current_ht_config.supported_chan_width + ==IWL_CHANNEL_WIDTH_40MHZ ) tbl->is_fat =1 ;else tbl->is_fat =0 ;if (tbl->is_fat) { -if (priv->current_assoc_ht.sgf &HT_SHORT_GI_40MHZ_ONLY ) +if (priv->current_ht_config.sgf &HT_SHORT_GI_40MHZ_ONLY ) tbl->is_SGI =1 ;else tbl->is_SGI =0 ; - }else if (priv->current_assoc_ht.sgf &HT_SHORT_GI_20MHZ_ONLY ) + }else if (priv->current_ht_config.sgf &HT_SHORT_GI_20MHZ_ONLY ) tbl->is_SGI =1 ;else tbl->is_SGI =0 ;
@@ -1001,6 +1008,8 @@ static int rs_switch_to_siso(struct iwl4965_priv *priv,static int rs_move_legacy_other (struct iwl4965_priv *priv,struct iwl4965_rate_scale_priv *lq_data, +struct ieee80211_conf *conf, +struct sta_info *sta,int index) {int ret =0 ;
@@ -1040,8 +1049,8 @@ static int rs_move_legacy_other(struct iwl4965_priv *priv, search_tbl->lq_type =LQ_SISO ; search_tbl->is_SGI =0 ; search_tbl->is_fat =0 ; - ret =rs_switch_to_siso (priv, lq_data, search_tbl, - index); + ret =rs_switch_to_siso (priv, lq_data, conf, sta, + search_tbl, index);if (!ret) { lq_data->search_better_tbl =1 ; lq_data->action_counter =0 ;
@@ -1056,8 +1065,8 @@ static int rs_move_legacy_other(struct iwl4965_priv *priv, search_tbl->is_SGI =0 ; search_tbl->is_fat =0 ; search_tbl->antenna_type =ANT_BOTH ; - ret =rs_switch_to_mimo (priv, lq_data, search_tbl, - index); + ret =rs_switch_to_mimo (priv, lq_data, conf, sta, + search_tbl, index);if (!ret) { lq_data->search_better_tbl =1 ; lq_data->action_counter =0 ;
@@ -1085,6 +1094,8 @@ static int rs_move_legacy_other(struct iwl4965_priv *priv,static int rs_move_siso_to_other (struct iwl4965_priv *priv,struct iwl4965_rate_scale_priv *lq_data, +struct ieee80211_conf *conf, +struct sta_info *sta,int index) {int ret;
@@ -1125,8 +1136,8 @@ static int rs_move_siso_to_other(struct iwl4965_priv *priv, search_tbl->is_SGI =0 ; search_tbl->is_fat =0 ; search_tbl->antenna_type =ANT_BOTH ; - ret =rs_switch_to_mimo (priv, lq_data, search_tbl, - index); + ret =rs_switch_to_mimo (priv, lq_data, conf, sta, + search_tbl, index);if (!ret) { lq_data->search_better_tbl =1 ; goto out;
@@ -1175,6 +1186,8 @@ static int rs_move_siso_to_other(struct iwl4965_priv *priv,static int rs_move_mimo_to_other (struct iwl4965_priv *priv,struct iwl4965_rate_scale_priv *lq_data, +struct ieee80211_conf *conf, +struct sta_info *sta,int index) {int ret;
@@ -1202,8 +1215,8 @@ static int rs_move_mimo_to_other(struct iwl4965_priv *priv,else search_tbl->antenna_type =ANT_AUX ; - ret =rs_switch_to_siso (priv, lq_data, search_tbl, - index); + ret =rs_switch_to_siso (priv, lq_data, conf, sta, + search_tbl, index);if (!ret) { lq_data->search_better_tbl =1 ; goto out;
@@ -1310,6 +1323,9 @@ static void rs_rate_scale_perform(struct iwl4965_priv *priv,struct ieee80211_hdr *hdr, struct sta_info *sta) { + struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); +struct ieee80211_hw *hw =local_to_hw (local); +struct ieee80211_conf *conf = &hw->conf;int low =IWL_RATE_INVALID ;int high =IWL_RATE_INVALID ;int index;
@@ -1548,11 +1564,11 @@ static void rs_rate_scale_perform(struct iwl4965_priv *priv, lq_data->last_tpt = current_tpt;if (is_legacy (tbl->lq_type)) -rs_move_legacy_other (priv, lq_data, index); +rs_move_legacy_other (priv, lq_data, conf, sta, index);else if (is_siso (tbl->lq_type)) -rs_move_siso_to_other (priv, lq_data, index); +rs_move_siso_to_other (priv, lq_data, conf, sta, index);else -rs_move_mimo_to_other (priv, lq_data, index); +rs_move_mimo_to_other (priv, lq_data, conf, sta, index);if (lq_data->search_better_tbl) { tbl = &(lq_data->lq_info[(1 - lq_data->active_tbl)]);
@@ -1572,7 +1588,7 @@ static void rs_rate_scale_perform(struct iwl4965_priv *priv,if (is_legacy (tbl1->lq_type) && #ifdef CONFIG_IWL4965_HT - !priv->current_assoc_ht.is_ht && + (!(conf->flags &IEEE80211_CONF_SUPPORT_HT_MODE )) && #endif (lq_data->action_counter >=1 )) { lq_data->action_counter =0 ;
@@ -1616,6 +1632,7 @@ out:static void rs_initialize_lq (struct iwl4965_priv *priv, +struct ieee80211_conf *conf,struct sta_info *sta) {int i;
@@ -1623,7 +1640,7 @@ static void rs_initialize_lq(struct iwl4965_priv *priv,struct iwl4965_scale_tbl_info *tbl;u8 active_tbl =0 ;int rate_idx; -u8 use_green =rs_use_green (priv); +u8 use_green =rs_use_green (priv, conf);struct iwl4965_rate mcs_rate;if (!sta || !sta->rate_ctrl_priv)
@@ -1692,6 +1709,7 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate,int i;struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); +struct ieee80211_conf *conf = &local->hw.conf;struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;struct sta_info *sta;u16 fc;
@@ -1735,7 +1753,7 @@ static struct ieee80211_rate *rs_get_rate(void *priv_rate, lq->lq.sta_id = sta_id; lq->lq.rs_table[0 ].rate_n_flags =0 ; lq->ibss_sta_added =1 ; -rs_initialize_lq (priv, sta); +rs_initialize_lq (priv, conf, sta); }if (!lq->ibss_sta_added) goto done;
@@ -1775,6 +1793,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, struct sta_info *sta) {int i, j; +struct ieee80211_conf *conf = &local->hw.conf;struct ieee80211_hw_mode *mode = local->oper_hw_mode;struct iwl4965_priv *priv = (struct iwl4965_priv *)priv_rate;struct iwl4965_rate_scale_priv *crl = priv_sta;
@@ -1830,19 +1849,21 @@ static void rs_rate_init(void *priv_rate, void *priv_sta, crl->is_dup =0 ; crl->valid_antenna = priv->valid_antenna; crl->antenna = priv->antenna; - crl->is_green =rs_use_green (priv); + crl->is_green =rs_use_green (priv, conf); crl->active_rate = priv->active_rate; crl->active_rate &= ~(0x1000 ); crl->active_rate_basic = priv->active_rate_basic; crl->phymode = priv->phymode;#ifdef CONFIG_IWL4965_HT - crl->active_siso_rate = (priv->current_assoc_ht.supp_rates[0 ] <<1 ); - crl->active_siso_rate |= (priv->current_assoc_ht.supp_rates[0 ] &0x1 ); + crl->active_siso_rate = (priv->current_ht_config.supp_mcs_set[0 ] <<1 ); + crl->active_siso_rate |= + (priv->current_ht_config.supp_mcs_set[0 ] &0x1 ); crl->active_siso_rate &= ~((u16 )0x2 ); crl->active_siso_rate = crl->active_siso_rate <<IWL_FIRST_OFDM_RATE ; - crl->active_mimo_rate = (priv->current_assoc_ht.supp_rates[1 ] <<1 ); - crl->active_mimo_rate |= (priv->current_assoc_ht.supp_rates[1 ] &0x1 ); + crl->active_mimo_rate = (priv->current_ht_config.supp_mcs_set[1 ] <<1 ); + crl->active_mimo_rate |= + (priv->current_ht_config.supp_mcs_set[1 ] &0x1 ); crl->active_mimo_rate &= ~((u16 )0x2 ); crl->active_mimo_rate = crl->active_mimo_rate <<IWL_FIRST_OFDM_RATE ; IWL_DEBUG_HT("MIMO RATE 0x%X SISO MASK 0x%X\n", crl->active_siso_rate,
@@ -1855,7 +1876,7 @@ static void rs_rate_init(void *priv_rate, void *priv_sta,if (priv->assoc_station_added) priv->lq_mngr.lq_ready =1 ; -rs_initialize_lq (priv, sta); +rs_initialize_lq (priv, conf, sta); } static void rs_fill_link_cmd(struct iwl4965_rate_scale_priv *lq_data,
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
PATCH 15/15 iwlwifi: 802.11n add support to 8K A-MSDU Rx frames
In reply to Ron RindjunskyThis patch give the iwlwifi the ability to support A-MSDU up to 8K
Please notice - in order to work in 8K A-MSDU ucode support is needed, version 4.44.1.19 (soon to be published). 4K A-MSDU works in current ucode version as well.
--- drivers/net/wireless/iwlwifi/iwl-3945-hw.h | 1 - drivers/net/wireless/iwlwifi/iwl-3945.c | 3 ++- drivers/net/wireless/iwlwifi/iwl-3945.h | 5 +++-- drivers/net/wireless/iwlwifi/iwl-4965-hw.h | 14 +++++++++----- drivers/net/wireless/iwlwifi/iwl-4965.c | 20 +++++++++++++++++--- drivers/net/wireless/iwlwifi/iwl-4965.h | 5 +++-- drivers/net/wireless/iwlwifi/iwl4965-base.c | 21 ++++++++++++++------- 7 files changed, 48 insertions(+), 21 deletions(-)
drivers/net/wireless/iwlwifi/iwl-3945-hw.h +0 -1
@@ -691,7 +691,6 @@ struct iwl3945_eeprom {#define RX_LOW_WATERMARK 8 -#define IWL_RX_BUF_SIZE 3000/* card static random access memory (SRAM) for processor data and instructs */ #define ALM_RTC_INST_UPPER_BOUND (0x014000)#define ALM_RTC_DATA_UPPER_BOUND (0x808000)
drivers/net/wireless/iwlwifi/iwl-3945.c +2 -1
@@ -2219,7 +2219,8 @@ int iwl3945_hw_set_hw_setting(struct iwl3945_priv *priv) } priv->hw_setting.ac_queue_count =AC_NUM ; - priv->hw_setting.rx_buffer_size =IWL_RX_BUF_SIZE ; + priv->hw_setting.rx_buf_size =IWL_RX_BUF_SIZE ; + priv->hw_setting.max_pkt_size =2342 ; priv->hw_setting.tx_cmd_len =sizeof (struct iwl3945_tx_cmd ); priv->hw_setting.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_setting.max_rxq_log =RX_QUEUE_SIZE_LOG ;
drivers/net/wireless/iwlwifi/iwl-3945.h +3 -2
@@ -72,6 +72,7 @@ enum iwl3945_antenna {* else RTS for data/management frames where MPDU is larger * than RTS value. */ +#define IWL_RX_BUF_SIZE 3000U#define DEFAULT_RTS_THRESHOLD 2347U#define MIN_RTS_THRESHOLD 0U#define MAX_RTS_THRESHOLD 2347U
@@ -447,7 +448,6 @@ union iwl3945_ht_rate_supp {#ifdef CONFIG_IWL3945_HT #define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) -#define HT_IE_MAX_AMSDU_SIZE_4K (0)#define CFG_HT_MPDU_DENSITY_2USEC (0x5)#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
@@ -552,7 +552,8 @@ struct iwl3945_driver_hw_info {u16 ac_queue_count;u16 tx_cmd_len;u16 max_rxq_size; -u32 rx_buffer_size; +u32 rx_buf_size; +u32 max_pkt_size;u16 max_rxq_log;u8 max_stations;u8 bcast_sta_id;
drivers/net/wireless/iwlwifi/iwl-4965-hw.h +9 -5
@@ -740,8 +740,8 @@ struct iwl4965_eeprom {#define RX_FREE_BUFFERS 64#define RX_LOW_WATERMARK 8 - -#define IWL_RX_BUF_SIZE (4 * 1024) +#define IWL_RX_BUF_SIZE_4K (4 * 1024) +#define IWL_RX_BUF_SIZE_8K (8 * 1024)#define IWL_MAX_BSM_SIZE BSM_SRAM_SIZE#define KDR_RTC_INST_UPPER_BOUND (0x018000)#define KDR_RTC_DATA_UPPER_BOUND (0x80A000)
@@ -1055,15 +1055,19 @@ union iwl4965_tx_power_dual_stream {#define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_MASK (0x00001000)/* bit 12 */ #define FH_RCSR_CHNL0_RX_CONFIG_RB_TIMEOUT_MASK (0x00000FF0)/* bit 4-11 */ -#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT (20) -#define FH_RCSR_RX_CONFIG_RB_SIZE_BITSHIFT (16) +#define FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT (20) +#define FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_BITSHIFT (4) +#define RX_RB_TIMEOUT (0x10)/* RCSR: rx_config register values */ #define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_VAL (0x00000000)#define FH_RCSR_RX_CONFIG_CHNL_EN_PAUSE_EOF_VAL (0x40000000)#define FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL (0x80000000) -#define IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K (0x00000000) +#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K (0x00000000) +#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K (0x00010000) +#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_12K (0x00020000) +#define FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_16K (0x00030000)/* RCSR channel 0 config register values */ #define FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_NO_INT_VAL (0x00000000)
drivers/net/wireless/iwlwifi/iwl-4965.c +17 -3
@@ -226,6 +226,7 @@ static int iwl4965_rx_init(struct iwl4965_priv *priv, struct iwl4965_rx_queue *r {int rc;unsigned long flags; +unsigned int rb_size;spin_lock_irqsave (&priv->lock, flags); rc =iwl4965_grab_nic_access (priv);
@@ -234,6 +235,11 @@ static int iwl4965_rx_init(struct iwl4965_priv *priv, struct iwl4965_rx_queue *rreturn rc; } +if (iwl4965_param_amsdu_size_8K) + rb_size =FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_8K ; +else + rb_size =FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K ; +/* stop HW */ iwl4965_write_direct32 (priv,FH_MEM_RCSR_CHNL0_CONFIG_REG ,0 );
@@ -248,7 +254,7 @@ static int iwl4965_rx_init(struct iwl4965_priv *priv, struct iwl4965_rx_queue *riwl4965_write_direct32 (priv,FH_MEM_RCSR_CHNL0_CONFIG_REG ,FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL |FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | -IWL_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K | + rb_size |/*0x10 << 4 | */ (RX_QUEUE_SIZE_LOG <<FH_RCSR_RX_CONFIG_RBDCB_SIZE_BITSHIFT ));
@@ -1721,7 +1727,11 @@ int iwl4965_hw_set_hw_setting(struct iwl4965_priv *priv) priv->hw_setting.tx_cmd_len =sizeof (struct iwl4965_tx_cmd ); priv->hw_setting.max_rxq_size =RX_QUEUE_SIZE ; priv->hw_setting.max_rxq_log =RX_QUEUE_SIZE_LOG ; - +if (iwl4965_param_amsdu_size_8K) + priv->hw_setting.rx_buf_size =IWL_RX_BUF_SIZE_8K ; +else + priv->hw_setting.rx_buf_size =IWL_RX_BUF_SIZE_4K ; + priv->hw_setting.max_pkt_size = priv->hw_setting.rx_buf_size -256 ; priv->hw_setting.max_stations =IWL4965_STATION_COUNT ; priv->hw_setting.bcast_sta_id =IWL4965_BROADCAST_ID ;return 0 ;
@@ -3519,7 +3529,7 @@ static void iwl4965_handle_data_packet(struct iwl4965_priv *priv, int is_data, rx_start->byte_count = amsdu->byte_count; rx_end = (__le32 *) (((u8 *) hdr) + len); } -if (len >IWL_RX_BUF_SIZE || len <16 ) { +if (len > priv->hw_setting.max_pkt_size || len <16 ) {IWL_WARNING ("byte count out of range [16,4K]" " : %d\n" , len);return ;
@@ -3685,6 +3695,10 @@ void iwl4965_init_ht_hw_capab(struct ieee80211_ht_info *ht_info, int mode) ht_info->cap |= (u16 )IEEE80211_HT_CAP_SGI_20 ; ht_info->cap |= (u16)(IEEE80211_HT_CAP_MIMO_PS & (IWL_MIMO_PS_NONE <<2 )); +if (iwl4965_param_amsdu_size_8K) { +printk (KERN_DEBUG "iwl4965 in A-MSDU 8K support mode\n" ); + ht_info->cap |= (u16 )IEEE80211_HT_CAP_MAX_AMSDU ; + } ht_info->ampdu_factor =CFG_HT_RX_AMPDU_FACTOR_DEF ; ht_info->ampdu_density =CFG_HT_MPDU_DENSITY_DEF ;
drivers/net/wireless/iwlwifi/iwl-4965.h +3 -2
@@ -56,6 +56,7 @@ extern struct pci_device_id iwl4965_hw_card_ids[];/* Module parameters accessible from iwl-*.c */ extern int iwl4965_param_hwcrypto;extern int iwl4965_param_queues_num; +extern int iwl4965_param_amsdu_size_8K;enum iwl4965_antenna {IWL_ANTENNA_DIVERSITY ,
@@ -473,7 +474,6 @@ union iwl4965_ht_rate_supp {#ifdef CONFIG_IWL4965_HT #define CFG_HT_RX_AMPDU_FACTOR_DEF (0x3) -#define HT_IE_MAX_AMSDU_SIZE_4K (0)#define CFG_HT_MPDU_DENSITY_2USEC (0x5)#define CFG_HT_MPDU_DENSITY_DEF CFG_HT_MPDU_DENSITY_2USEC
@@ -572,7 +572,8 @@ struct iwl4965_driver_hw_info {u16 ac_queue_count;u16 tx_cmd_len;u16 max_rxq_size; -u32 rx_buffer_size; +u32 rx_buf_size; +u32 max_pkt_size;u16 max_rxq_log;u8 max_stations;u8 bcast_sta_id;
drivers/net/wireless/iwlwifi/iwl4965-base.c +14 -7
@@ -80,6 +80,7 @@ static int iwl4965_param_antenna; /* def: 0 = both antennas (use diversity)int iwl4965_param_hwcrypto;/* def: using software encryption */ static int iwl4965_param_qos_enable =1 ;int iwl4965_param_queues_num =IWL_MAX_NUM_QUEUES ; +int iwl4965_param_amsdu_size_8K;/* def: enable 8K amsdu size */ /* * module name, copyright, version, etc.
@@ -3164,7 +3165,7 @@ void iwl4965_handle_data_packet_monitor(struct iwl4965_priv *priv,__le16 phy_flags_hw =cpu_to_le16 (phy_flags);/* We received data from the HW, so stop the watchdog */ -if (len >IWL_RX_BUF_SIZE -sizeof (*iwl4965_rt)) { +if (len > priv->hw_setting.rx_buf_size -sizeof (*iwl4965_rt)) {IWL_DEBUG_DROP ("Dropping too large packet in monitor\n" );return ; }
@@ -4393,7 +4394,8 @@ void iwl4965_rx_replenish(void *data) element = rxq->rx_used.next; rxb = list_entry(element, struct iwl4965_rx_mem_buffer, list); rxb->skb = -alloc_skb (IWL_RX_BUF_SIZE , __GFP_NOWARN |GFP_ATOMIC ); +alloc_skb (priv->hw_setting.rx_buf_size, + __GFP_NOWARN |GFP_ATOMIC ); if (!rxb->skb) { if (net_ratelimit()) printk(KERN_CRIT DRV_NAME
@@ -4407,7 +4409,7 @@ void iwl4965_rx_replenish(void *data)list_del (element); rxb->dma_addr =pci_map_single (priv->pci_dev, rxb->skb->data, -IWL_RX_BUF_SIZE ,PCI_DMA_FROMDEVICE ); + priv->hw_setting.rx_buf_size,PCI_DMA_FROMDEVICE );list_add_tail (&rxb->list, &rxq->rx_free); rxq->free_count++; }
@@ -4430,7 +4432,8 @@ static void iwl4965_rx_queue_free(struct iwl4965_priv *priv, struct iwl4965_rx_qif (rxq->pool[i].skb !=NULL ) {pci_unmap_single (priv->pci_dev, rxq->pool[i].dma_addr, -IWL_RX_BUF_SIZE ,PCI_DMA_FROMDEVICE ); + priv->hw_setting.rx_buf_size, +PCI_DMA_FROMDEVICE );dev_kfree_skb (rxq->pool[i].skb); } }
@@ -4477,7 +4480,8 @@ void iwl4965_rx_queue_reset(struct iwl4965_priv *priv, struct iwl4965_rx_queue *if (rxq->pool[i].skb !=NULL ) {pci_unmap_single (priv->pci_dev, rxq->pool[i].dma_addr, -IWL_RX_BUF_SIZE ,PCI_DMA_FROMDEVICE ); + priv->hw_setting.rx_buf_size, +PCI_DMA_FROMDEVICE ); priv->alloc_rxb_skb--;dev_kfree_skb (rxq->pool[i].skb); rxq->pool[i].skb =NULL ;
@@ -4604,7 +4608,7 @@ static void iwl4965_rx_handle(struct iwl4965_priv *priv) rxq->queue[i] =NULL ;pci_dma_sync_single_for_cpu (priv->pci_dev, rxb->dma_addr, -IWL_RX_BUF_SIZE , + priv->hw_setting.rx_buf_size,PCI_DMA_FROMDEVICE ); pkt = (struct iwl4965_rx_packet *)rxb->skb->data;
@@ -4657,7 +4661,8 @@ static void iwl4965_rx_handle(struct iwl4965_priv *priv) }pci_unmap_single (priv->pci_dev, rxb->dma_addr, -IWL_RX_BUF_SIZE ,PCI_DMA_FROMDEVICE ); + priv->hw_setting.rx_buf_size, +PCI_DMA_FROMDEVICE );spin_lock_irqsave (&rxq->lock, flags);list_add_tail (&rxb->list, &priv->rxq.rx_used);spin_unlock_irqrestore (&rxq->lock, flags);
@@ -9303,6 +9308,8 @@ MODULE_PARM_DESC(queues_num, "number of hw queues.");/* QoS */ module_param_named (qos_enable, iwl4965_param_qos_enable, int,0444 );MODULE_PARM_DESC (qos_enable,"enable all QoS functionality" ); +module_param_named (amsdu_size_8K, iwl4965_param_amsdu_size_8K, int,0444 ); +MODULE_PARM_DESC (amsdu_size_8K,"enable 8K amsdu size" );module_exit (iwl4965_exit);module_init (iwl4965_init);
Signature · 8 lines
1.5.3.3 --------------------------------------------------------------------- Intel Israel (74) Limited This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
Johannes Berg
maintainerRe: [PATCH 15/15] iwlwifi: 802.11n add support to 8K A-MSDU Rx frames
drivers/net/wireless/iwlwifi/iwl4965-base.c MODULE_PARM_DESC(queues_num, "number of hw queues."); · line 9312
Quoted 7 lines
Please notice - in order to work in 8K A-MSDU ucode support is needed, version 4.44.1.19 (soon to be published). 4K A-MSDU works in current ucode version as well.
drivers/net/wireless/iwlwifi/iwl4965-base.c +2
-0+module_param_named (amsdu_size_8K, iwl4965_param_amsdu_size_8K, int,0444 ); +MODULE_PARM_DESC (amsdu_size_8K,"enable 8K amsdu size" );
Can't you read the ucode version instead?
johannes
Re: [PATCH 15/15] iwlwifi: 802.11n add support to 8K A-MSDU Rx frames
Quoted 10 lines · Johannes Berg
drivers/net/wireless/iwlwifi/iwl4965-base.c MODULE_PARM_DESC(queues_num, "number of hw queues."); · line 9312
Quoted 7 lines
Please notice - in order to work in 8K A-MSDU ucode support is needed, version 4.44.1.19 (soon to be published). 4K A-MSDU works in current ucode version as well.
drivers/net/wireless/iwlwifi/iwl4965-base.c +2
-0+module_param_named (amsdu_size_8K, iwl4965_param_amsdu_size_8K, int,0444 ); +MODULE_PARM_DESC (amsdu_size_8K,"enable 8K amsdu size" );Can't you read the ucode version instead?
8K uCode supports both 4K and 8K A-MSDU. Using 8K is very memory demanding and we want to leave it configurable for using on embedded platforms
Tomas
Quoted 2 lines
johannes
Quoted 38 lines · Ron Rindjunsky
This series of patches contains all 802.11n code + fixes of comments to the first two cycles of 802.11n patches.
Fixed list:
===========
- removingMAC80211_HTfrom config and all *.[ch] files
- removing IWL4965 config dependency onMAC80211_HT
- addingMAC80211_HT_DEBUGto config file and to relevant places
- refine TODO remark inieee80211_sta_process_addba_request
-net_ratelimit()added to relevant prints
- renamingieee80211_rx_h_data_aggtoieee80211_rx_h_amsdu
- removing parentheses fromIEEE80211_CONF_SUPPORT_HT_MODEuse
- changingamsdu_frametype from u16 to u8
- adding defineSUPP_MCS_SET_LEN16 to indicate MCS set length
- fixes to some typos
- Changes to Rx handlers PAE and drop unencrypted (for EAPOL frames in amsdu)If this series is accepted then next series will contain the follow:
TODO list (planned for next series of patches)
==============================================
- Full A-MPDU aggregation capability.
- AP flows
- Examine config flows in mac80211 (RFC is prepered)Notes to this series:
======================
This series of patches splits into two parts:
- patches 1-7 add 802.11n support to mac80211.
- patches 8-15 demonstrates the use of the above mac80211's 802.11n framework through iwl4965 low level driverIn order to be compatible with the 802.11n requirements for an HT station, patches 1-7 should not be treated as stand alone patches, but as a complete framework, although separation to patches by subjects was made for ease of handling. This applies to patches 8-15 as well.
The patches do _not_ break any existing driver.
Quoted 8 lines
patches were made (and tested to work) with wireless branch 2.6.24-rc3 (#everything)
The framework includes the following:
- HT probing.
- HT association.
- Support in Rx A-MSDU.
- Support in A-MPDU addBA request.
- HT information and configuration delivery to both low-level driver and rate scaling.
Ron I haven't been able to review your 802.11n patches yet due to time but I do remember seeing some "channel" variable in a struct somewhere at a quick glance on your 802.11n patch series. It was determined a little while ago that we'd move from static channels to frequency instead. One reason for this is to stick to 'one' thing later for regulatory purposes. Another reason that came up later is that frequency be relied upon even on 5GHz reliably contrary to channel number -- in 5GHz the channel numbers can be mapped arbitrarily depending on the regulatory agency your country falls under. Would it be too much if you used frequency instead of channel or does the the 802.11n draft specs say you have to use channel somewhere?
Sorry I couldn't pin point the specific patch yet.
Luis
Quoted 12 lines
Ron I haven't been able to review your 802.11n patches yet due to time but I do remember seeing some "channel" variable in a struct somewhere at a quick glance on your 802.11n patch series. It was determined a little while ago that we'd move from static channels to frequency instead. One reason for this is to stick to 'one' thing later for regulatory purposes. Another reason that came up later is that frequency be relied upon even on 5GHz reliably contrary to channel number -- in 5GHz the channel numbers can be mapped arbitrarily depending on the regulatory agency your country falls under. Would it be too much if you used frequency instead of channel or does the the 802.11n draft specs say you have to use channel somewhere?
Quoted 1 line
Sorry I couldn't pin point the specific patch yet.
it will be helpful to know the specific place where you spotted it, but i will assume you are relating to the channel width and offset?. in that case i took the 802.11n spec name from 2 reasons:
1 - to be clearer to code readers as to right place in the spec 2 - the spec strongly relates to 20/40 Mhz capabilities of the channel, not to the channel itself, (e.g. extention channel), so i saw no reason to break it and to go to frequencies.
ron
Quoted 2 lines
Luis