iwlwifi: add IWLWIFI_HT Kconfig option
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/7 iwlwifi: add IWLWIFI_HT Kconfig option
--- drivers/net/wireless/Kconfig | 9 +++++++++ 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/net/wireless/Kconfig +9 -0
@@ -768,6 +768,15 @@ config IWLWIFI_DEBUG as the debug information can assist others in helping you resolve any problems you may encounter. +config IWLWIFI_HT + bool "Enable 802.11n HT features in iwlwifi drivers" + depends on EXPERIMENTAL + depends on IWLWIFI && MAC80211_HT + default n + ---help--- + This option enables IEEE 802.11n High Throughput features + for the iwlwifi drivers. + config IWL4965 tristate "Intel Wireless WiFi 4965AGN" depends on m && IWLWIFI && EXPERIMENTAL
Signature · 1 line
1.5.2
PATCH 2/7 iwlwifi: fix rate setting in beacon command
From: Tomas Winkler <[email protected]>
This patch fixed rate setting in beacon command. It removes invalid <= comparsion on unsinged values.
--- drivers/net/wireless/iwl-3945.c | 2 +- drivers/net/wireless/iwl-4965.c | 11 ++++++----- drivers/net/wireless/iwl-base.c | 6 +++--- drivers/net/wireless/iwlwifi.h | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-)
drivers/net/wireless/iwl-3945.c +1 -1
@@ -2231,7 +2231,7 @@ int iwl_hw_set_hw_setting(struct iwl_priv *priv) }int iwl_hw_get_beacon_cmd (struct iwl_priv *priv, -struct iwl_frame *frame,u16 rate) +struct iwl_frame *frame,u8 rate) {struct iwl_tx_beacon_cmd *tx_beacon_cmd;int frame_size;
drivers/net/wireless/iwl-4965.c +6 -5
@@ -2718,14 +2718,11 @@ int iwl_hw_get_temperature(struct iwl_priv *priv) }int iwl_hw_get_beacon_cmd (struct iwl_priv *priv, -struct iwl_frame *frame,u16 rate) +struct iwl_frame *frame,u8 rate) {struct iwl_tx_beacon_cmd *tx_beacon_cmd;int frame_size; -if ((rate ==IWL_RATE_1M_PLCP ) || (rate >=IWL_RATE_2M_PLCP )) - rate |=RATE_MCS_CCK_MSK ; - tx_beacon_cmd = &frame->u.beacon;memset (tx_beacon_cmd,0 ,sizeof (*tx_beacon_cmd));
@@ -2739,7 +2736,11 @@ int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, tx_beacon_cmd->tx.len = frame_size; - tx_beacon_cmd->tx.rate.rate_n_flags = rate; +if ((rate ==IWL_RATE_1M_PLCP ) || (rate >=IWL_RATE_2M_PLCP )) + tx_beacon_cmd->tx.rate.rate_n_flags = rate|RATE_MCS_CCK_MSK ; +else + tx_beacon_cmd->tx.rate.rate_n_flags = rate; + tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |TX_CMD_FLG_TSF_MSK |TX_CMD_FLG_STA_RATE_MSK );return (sizeof (*tx_beacon_cmd) + frame_size);
drivers/net/wireless/iwl-base.c +3 -3
@@ -1487,7 +1487,7 @@ static int iwl_send_beacon_cmd(struct iwl_priv *priv) {struct iwl_frame *frame;int frame_size, rc; -u16 rate; +u8 rate; frame =iwl_get_free_frame (priv);
@@ -1500,11 +1500,11 @@ static int iwl_send_beacon_cmd(struct iwl_priv *priv)if (!(priv->staging_rxon.flags &RXON_FLG_BAND_24G_MSK )) { rate =iwl_rate_get_lowest_plcp (priv->active_rate_basic &0xFF0 ); -if (rate <=0 ) +if (rate ==IWL_INVALID_RATE ) rate =IWL_RATE_6M_PLCP ; }else { rate =iwl_rate_get_lowest_plcp (priv->active_rate_basic &0xF ); -if (rate <=0 ) +if (rate ==IWL_INVALID_RATE ) rate =IWL_RATE_1M_PLCP ; }
drivers/net/wireless/iwlwifi.h +1 -1
@@ -692,7 +692,7 @@ extern int iwl_tx_queue_free_tfd(struct iwl_priv *priv,extern int iwl_hw_tx_queue_init (struct iwl_priv *priv,struct iwl_tx_queue *txq);extern int iwl_hw_get_beacon_cmd (struct iwl_priv *priv, -struct iwl_frame *frame,u16 rate); +struct iwl_frame *frame,u8 rate);extern int iwl_hw_get_rx_read (struct iwl_priv *priv); extern void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct iwl_cmd *cmd,
Signature · 1 line
1.5.2
PATCH 3/7 iwlwifi: Endianity fix for TX host command
From: Tomas Winkler <[email protected]>
This patch fixes endnianity issues in TX host command.
--- drivers/net/wireless/iwl-3945-hw.h | 10 ++++++++++ drivers/net/wireless/iwl-4965-hw.h | 10 +++++++++- drivers/net/wireless/iwl-4965.c | 26 ++++++++++++++------------ drivers/net/wireless/iwl-base.c | 10 ++++++---- drivers/net/wireless/iwl-commands.h | 2 +- drivers/net/wireless/iwl-hw.h | 10 +++++----- 6 files changed, 45 insertions(+), 23 deletions(-)
drivers/net/wireless/iwl-3945-hw.h +10 -0
@@ -87,4 +87,14 @@ struct iwl_tfd_frame {u8 reserved[28 ]; } __attribute__ ((packed)); +static inline u8 iwl_hw_get_rate (__le16 rate_n_flags) +{ +return le16_to_cpu (rate_n_flags) &0xFF ; +} + +static inline u16 iwl_hw_get_rate_n_flags (__le16 rate_n_flags) +{ +return le16_to_cpu (rate_n_flags); +} +#endif
drivers/net/wireless/iwl-4965-hw.h +9 -1
@@ -768,10 +768,18 @@ struct iwl4965_rx_mpdu_res_start {__le16 reserved; } __attribute__ ((packed)); -static inline u8 iwl4965_get_rate (__le32 rate_n_flags) +static inline u8 iwl_hw_get_rate (__le32 rate_n_flags) {return le32_to_cpu (rate_n_flags) &0xFF ; } +static inline u16 iwl_hw_get_rate_n_flags (__le32 rate_n_flags) +{ +return le32_to_cpu (rate_n_flags) &0xFFFF ; +} +static inline __le32 iwl_hw_set_rate_n_flags (u8 rate,u16 flags) +{ +return cpu_to_le32 (flags|rate); +}#if 0 union iwl_dram_scratch_union {
drivers/net/wireless/iwl-4965.c +14 -12
@@ -2660,7 +2660,7 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, struct ieee80211_hdr *hdr, int sta_id, int is_hcca) { - int rate = ctrl->tx_rate; + u8 rate;u8 rts_retry_limit =0 ;u8 data_retry_limit =0 ;u32 tx_flags;
@@ -2700,7 +2700,7 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv, cmd->cmd.tx.rts_retry_limit = rts_retry_limit; cmd->cmd.tx.data_retry_limit = data_retry_limit; - cmd->cmd.tx.rate.s.rate = rate; + cmd->cmd.tx.rate_n_flags =iwl_hw_set_rate_n_flags (rate,0 ); cmd->cmd.tx.tx_flags = tx_flags; }
@@ -2737,9 +2737,11 @@ int iwl_hw_get_beacon_cmd(struct iwl_priv *priv, tx_beacon_cmd->tx.len = frame_size;if ((rate ==IWL_RATE_1M_PLCP ) || (rate >=IWL_RATE_2M_PLCP )) - tx_beacon_cmd->tx.rate.rate_n_flags = rate|RATE_MCS_CCK_MSK ; + tx_beacon_cmd->tx.rate_n_flags = +iwl_hw_set_rate_n_flags (rate,RATE_MCS_CCK_MSK );else - tx_beacon_cmd->tx.rate.rate_n_flags = rate; + tx_beacon_cmd->tx.rate_n_flags = +iwl_hw_set_rate_n_flags (rate,0 ); tx_beacon_cmd->tx.tx_flags = (TX_CMD_FLG_SEQ_CTL_MSK |TX_CMD_FLG_TSF_MSK |TX_CMD_FLG_STA_RATE_MSK );
@@ -3249,6 +3251,7 @@ int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd,u8 unicast =0 ;u8 is_data =1 ;u16 fc; +u16 rate_flags;int rate_index =min (ctrl->tx_rate &0xffff ,IWL_RATE_COUNT -1 );#ifdef CONFIG_IWLWIFI_HT #ifdef CONFIG_IWLWIFI_HT_AGG
@@ -3290,29 +3293,28 @@ int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd,/* Hard coded to start at the highest retry fallback position * until the 4965 specific rate control algorithm is tied in */ tx->initial_rate_index =LINK_QUAL_MAX_RETRY_NUM -1 ; - tx->rate.s.rate = iwl_rates[rate_index].plcp;/* Alternate between antenna A and B for successive frames */ if (priv->use_ant_b_for_management_frame) { priv->use_ant_b_for_management_frame =0 ; - tx->rate.rate_n_flags |=RATE_MCS_ANT_B_MSK ; - tx->rate.rate_n_flags &= ~RATE_MCS_ANT_A_MSK ; + rate_flags =RATE_MCS_ANT_B_MSK ; }else { priv->use_ant_b_for_management_frame =1 ; - tx->rate.rate_n_flags |=RATE_MCS_ANT_A_MSK ; - tx->rate.rate_n_flags &= ~RATE_MCS_ANT_B_MSK ; + rate_flags =RATE_MCS_ANT_A_MSK ; }if (!unicast || !is_data ) {if ((rate_index >=IWL_FIRST_CCK_RATE ) && (rate_index <=IWL_LAST_CCK_RATE )) - tx->rate.rate_n_flags |=RATE_MCS_CCK_MSK ; - + rate_flags |=RATE_MCS_CCK_MSK ; }else { tx->initial_rate_index =0 ; tx->tx_flags |=TX_CMD_FLG_STA_RATE_MSK ; } + tx->rate_n_flags =iwl_hw_set_rate_n_flags (iwl_rates[rate_index].plcp, + rate_flags); +if (ieee80211_is_probe_request (fc)) tx->tx_flags |=TX_CMD_FLG_TSF_MSK ;else if (ieee80211_is_back_request (fc))
@@ -3825,7 +3827,7 @@ static void iwl4965_rx_reply_rx(struct iwl_priv *priv, (rx_start->phy_flags &RX_RES_PHY_FLAGS_BAND_24_MSK ) ? MODE_IEEE80211G : MODE_IEEE80211A, .antenna = 0, - .rate = iwl4965_get_rate(rx_start->rate_n_flags), + .rate = iwl_hw_get_rate(rx_start->rate_n_flags), .flag =le16_to_cpu (rx_start->phy_flags), #ifdef CONFIG_IWLWIFI_HT_AGG .ordered =0
drivers/net/wireless/iwl-base.c +6 -4
@@ -7087,8 +7087,9 @@ static void iwl_bg_request_scan(struct work_struct *data)#if IWL ==3945 scan->tx_cmd.rate =IWL_RATE_1M_PLCP ;#elif IWL ==4965 - scan->tx_cmd.rate.s.rate =IWL_RATE_1M_PLCP ; - scan->tx_cmd.rate.s.flags =0x80 |0x2 ; + scan->tx_cmd.rate_n_flags = +iwl_hw_set_rate_n_flags (IWL_RATE_1M_PLCP , +RATE_MCS_ANT_B_MSK |RATE_MCS_CCK_MSK );#endif scan->good_CRC_th =0 ; phymode =MODE_IEEE80211G ;
@@ -7098,8 +7099,9 @@ static void iwl_bg_request_scan(struct work_struct *data)#if IWL ==3945 scan->tx_cmd.rate =IWL_RATE_6M_PLCP ;#elif IWL ==4965 - scan->tx_cmd.rate.s.rate =IWL_RATE_6M_PLCP ; - scan->tx_cmd.rate.s.flags =0x80 ; + scan->tx_cmd.rate_n_flags = +iwl_hw_set_rate_n_flags (IWL_RATE_6M_PLCP , +RATE_MCS_ANT_B_MSK );#endif scan->good_CRC_th =IWL_GOOD_CRC_TH ; phymode =MODE_IEEE80211A ;
drivers/net/wireless/iwl-commands.h +1 -1
@@ -245,7 +245,7 @@ struct iwl_tx_cmd {u8 tid_tspec;#elif IWL ==4965 struct iwl_dram_scratch scratch; -struct iwl_rate rate; +__le32 rate_n_flags;u8 sta_id;#endif u8 sec_ctl;
drivers/net/wireless/iwl-hw.h +5 -5
@@ -322,11 +322,11 @@ enum {* 10 B active, A inactive * 11 Both active */ -#define RATE_MCS_ANT_A_POS 14 -#define RATE_MCS_ANT_B_POS 15 -#define RATE_MCS_ANT_A_MSK __constant_cpu_to_le16(0x4000) -#define RATE_MCS_ANT_B_MSK __constant_cpu_to_le16(0x8000) -#define RATE_MCS_ANT_AB_MSK __constant_cpu_to_le16(0xc000) +#define RATE_MCS_ANT_A_POS 14 +#define RATE_MCS_ANT_B_POS 15 +#define RATE_MCS_ANT_A_MSK 0x4000 +#define RATE_MCS_ANT_B_MSK 0x8000 +#define RATE_MCS_ANT_AB_MSK 0xc000/* * WEP/CKIP group key command
Signature · 1 line
1.5.2
PATCH 4/7 iwlwifi: Endainity fix for rx configuration
From: Tomas Winkler <[email protected]>
This patch fixes endianity issues in rx configuration related code.
--- drivers/net/wireless/iwl-4965.c | 26 ++++--- drivers/net/wireless/iwl-base.c | 148 +++++++++++++++++++++------------------ drivers/net/wireless/iwl-hw.h | 10 ++-- 3 files changed, 101 insertions(+), 83 deletions(-)
drivers/net/wireless/iwl-4965.c +16 -10
@@ -3615,8 +3615,8 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, hdr = (void *)(pkt->u.raw +sizeof (struct iwl4965_rx_mpdu_res_start )); - rx_end = (u32 *) (((u8 *) hdr) + amsdu->byte_count); len = amsdu->byte_count; + rx_end = (u32 *) (((u8 *) hdr) + len); rx_start->byte_count = len; }if (len >2342 || len <16 ) {
@@ -4130,21 +4130,25 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv, {int i, sh, ack; +u16 ba_seq_ctl =le16_to_cpu (ba_resp->ba_seq_ctl);u32 bitmap0, bitmap1; +u32 resp_bitmap0 =le32_to_cpu (ba_resp->ba_bitmap0); +u32 resp_bitmap1 =le32_to_cpu (ba_resp->ba_bitmap1); +if (unlikely (!agg->wait_for_ba)) {IWL_ERROR ("Received BA when not expected\n" );return -EINVAL ; } agg->wait_for_ba =0 ;IWL_DEBUG_TX_REPLY ("BA %d %d\n" , agg->start_idx, ba_resp->ba_seq_ctl); - sh = agg->start_idx -SEQ_TO_INDEX (ba_resp->ba_seq_ctl>>4 ); + sh = agg->start_idx -SEQ_TO_INDEX (ba_seq_ctl>>4 );if (sh <0 )/* tbw something is wrong with indeces */ sh +=0x100 ;/* don't use 64 bits for now */ - bitmap0 = ba_resp->ba_bitmap0 >> sh; - bitmap1 = ba_resp->ba_bitmap1 >> sh; - bitmap0 |= (ba_resp->ba_bitmap1 & ((1 <<sh)|((1 <<sh)-1 ))) << (32 - sh); + bitmap0 = resp_bitmap0 >> sh; + bitmap1 = resp_bitmap1 >> sh; + bitmap0 |= (resp_bitmap1 & ((1 <<sh)|((1 <<sh)-1 ))) << (32 - sh);if (agg->frame_count > (64 - sh)) {IWL_DEBUG_TX_REPLY ("more frames than bitmap size" );
@@ -4184,15 +4188,17 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,int index;struct iwl_tx_queue *txq =NULL ;struct iwl_ht_agg *agg; +u16 ba_resp_scd_flow =le16_to_cpu (ba_resp->scd_flow); +u16 ba_resp_scd_ssn =le16_to_cpu (ba_resp->scd_ssn); -if (ba_resp->scd_flow >=ARRAY_SIZE (priv->txq)) { +if (ba_resp_scd_flow >=ARRAY_SIZE (priv->txq)) {IWL_ERROR ("BUG_ON scd_flow is bigger than number of queues" );return ; } - txq = &priv->txq[ba_resp->scd_flow]; + txq = &priv->txq[ba_resp_scd_flow]; agg = &priv->stations[ba_resp->sta_id].tid[ba_resp->tid].agg; - index =iwl_queue_dec_wrap (ba_resp->scd_ssn &0xff , txq->q.n_bd); + index =iwl_queue_dec_wrap (ba_resp_scd_ssn &0xff , txq->q.n_bd);/* TODO: Need to get this copy more sefely - now good for debug */ /*
@@ -4216,8 +4222,8 @@ static void iwl4965_rx_reply_compressed_ba(struct iwl_priv *priv,*/ iwl4965_tx_status_reply_compressed_ba (priv, agg, ba_resp);/* releases all the TFDs until the SSN */ -if (txq->q.last_used != (ba_resp->scd_ssn &0xff )) -iwl_tx_queue_reclaim (priv, ba_resp ->scd_flow, index); +if (txq->q.last_used != (ba_resp_scd_ssn &0xff )) +iwl_tx_queue_reclaim (priv, ba_resp_scd_flow, index); }
drivers/net/wireless/iwl-base.c +80 -68
363 lines not on this page · raw message
drivers/net/wireless/iwl-hw.h +5 -5
@@ -368,10 +368,10 @@ struct iwl_rx_frame_hdr {#define RX_RES_STATUS_NO_RXE_OVERFLOW __constant_cpu_to_le32(1 << 1)#define RX_RES_PHY_FLAGS_BAND_24_MSK __constant_cpu_to_le16(1 << 0) -#define RX_RES_PHY_FLAGS_MOD_CCK_MSK (1 << 1) -#define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK (1 << 2) -#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK (1 << 3) -#define RX_RES_PHY_FLAGS_ANTENNA_MSK 0xf0 +#define RX_RES_PHY_FLAGS_MOD_CCK_MSK __constant_cpu_to_le16(1 << 1) +#define RX_RES_PHY_FLAGS_SHORT_PREAMBLE_MSK __constant_cpu_to_le16(1 << 2) +#define RX_RES_PHY_FLAGS_NARROW_BAND_MSK __constant_cpu_to_le16(1 << 3) +#define RX_RES_PHY_FLAGS_ANTENNA_MSK __constant_cpu_to_le16(0xf0)#define RX_RES_STATUS_SEC_TYPE_MSK (0x7 << 8)#define RX_RES_STATUS_SEC_TYPE_NONE (0x0 << 8)
@@ -422,7 +422,7 @@ struct iwl_txpowertable_cmd {*/ /* Can abort will notify by complete notification with abort status. */ -#define CAN_ABORT_STATUS 0x1 +#define CAN_ABORT_STATUS __constant_cpu_to_le32(0x1)struct iwl_scanreq_notification {__le32 status;
Signature · 1 line
1.5.2
PATCH 5/7 iwlwifi: Endianity fixes for 3945
From: Tomas Winkler <[email protected]>
This patch fixes most of endianity issues in iwl-3945.c.
--- drivers/net/wireless/iwl-3945.c | 23 ++++++++++++----------- 1 files changed, 12 insertions(+), 11 deletions(-)
drivers/net/wireless/iwl-3945.c +12 -11
@@ -295,6 +295,8 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,struct iwl_rx_frame_end *rx_end =IWL_RX_END (pkt);struct ieee80211_hdr *header;u16 phy_flags =le16_to_cpu (rx_hdr->phy_flags); +u16 rx_stats_sig_avg =le16_to_cpu (rx_stats->sig_avg); +u16 rx_stats_noise_diff =le16_to_cpu (rx_stats->noise_diff);struct ieee80211_rx_status stats = { .mactime =le32_to_cpu (rx_end->beacon_timestamp), .freq =ieee80211chan2mhz (le16_to_cpu (rx_hdr->channel)),
@@ -316,9 +318,8 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,return ; } -if (!(le32_to_cpu (rx_end->status) &RX_RES_STATUS_NO_CRC32_ERROR ) - || !(le32_to_cpu (rx_end->status) & -RX_RES_STATUS_NO_RXE_OVERFLOW )) { +if (!(rx_end->status &RX_RES_STATUS_NO_CRC32_ERROR ) + || !(rx_end->status &RX_RES_STATUS_NO_RXE_OVERFLOW )) {IWL_DEBUG_RX ("Bad CRC or FIFO: 0x%08X.\n" , rx_end->status);return ; }
@@ -349,8 +350,8 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,* Convert linear SNR to dB SNR, then subtract that from rssi dBm * to obtain noise level in dBm. * Calculate stats.signal (quality indicator in %) based on SNR. */ -if (rx_stats->noise_diff) { - snr = rx_stats->sig_avg / rx_stats->noise_diff; +if (rx_stats_noise_diff) { + snr = rx_stats_sig_avg / rx_stats_noise_diff; stats.noise = stats.ssi -iwl_calc_db_from_ratio (snr); stats.signal =iwl_calc_sig_qual (stats.ssi, stats.noise);
@@ -364,7 +365,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv,IWL_DEBUG_STATS ("Rssi %d noise %d qual %d sig_avg %d noise_diff %d\n" , stats.ssi, stats.noise, stats.signal, - rx_stats->sig_avg, rx_stats->noise_diff); + rx_stats_sig_avg, rx_stats_noise_diff); stats.freq =ieee80211chan2mhz (stats.channel);
@@ -415,7 +416,7 @@ static void iwl3945_rx_reply_rx(struct iwl_priv *priv, pos = (__le32 *) & mgmt->u.beacon. timestamp; - priv->timestamp0 =le64_to_cpu (pos[0 ]); + priv->timestamp0 =le32_to_cpu (pos[0 ]); priv->timestamp1 =le32_to_cpu (pos[1 ]); priv->beacon_int =le16_to_cpu ( mgmt->u.beacon.beacon_int);
@@ -597,7 +598,7 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,int rate;u8 rts_retry_limit;u8 data_retry_limit; -u32 tx_flags; +__le32 tx_flags;u16 fc =le16_to_cpu (hdr->frame_control); rate = iwl_rates[rate_index].plcp;
@@ -663,7 +664,7 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,"cck/ofdm mask: 0x%x/0x%x\n" , sta_id, cmd->cmd.tx.rate, -BIT_ARG16 (cmd->cmd.tx.tx_flags), +BIT_ARG16 (le32_to_cpu (cmd->cmd.tx.tx_flags)), cmd->cmd.tx.supp_rates[1], cmd->cmd.tx.supp_rates[0]); }
@@ -2108,7 +2109,7 @@ int iwl_hw_tx_queue_init(struct iwl_priv *priv, struct iwl_tx_queue *txq)struct iwl_shared *shared_data = priv->hw_setting.shared_virt; - shared_data->tx_base_ptr[txq_id] = (u32 ) txq->q.dma_addr; + shared_data->tx_base_ptr[txq_id] =cpu_to_le32 ((u32 )txq->q.dma_addr);spin_lock_irqsave (&priv->lock, flags); rc =iwl_grab_restricted_access (priv);
@@ -2140,7 +2141,7 @@ int iwl_hw_get_rx_read(struct iwl_priv *priv)struct iwl_shared *shared_data = (struct iwl_shared *)priv->hw_setting.shared_virt; -return shared_data->rx_read_ptr[0 ]; +return le32_to_cpu (shared_data->rx_read_ptr[0 ]); }/**
Signature · 1 line
1.5.2
PATCH 6/7 iwlwifi: Endianity fix for tx configuration
From: Tomas Winkler <[email protected]>
This patch fixes most of the endianity issues in the TX configuration path.
--- drivers/net/wireless/iwl-4965-hw.h | 2 +- drivers/net/wireless/iwl-4965.c | 7 +- drivers/net/wireless/iwl-base.c | 158 ++++++++++++++++++----------------- drivers/net/wireless/iwl-commands.h | 88 ++++++++++---------- drivers/net/wireless/iwl-hw.h | 2 +- drivers/net/wireless/iwlwifi.h | 5 +- 6 files changed, 135 insertions(+), 127 deletions(-)
drivers/net/wireless/iwl-4965-hw.h +1 -1
@@ -778,7 +778,7 @@ static inline u16 iwl_hw_get_rate_n_flags(__le32 rate_n_flags) }static inline __le32 iwl_hw_set_rate_n_flags (u8 rate,u16 flags) { -return cpu_to_le32 (flags|rate); +return cpu_to_le32 (flags|(u16 )rate); }#if 0
drivers/net/wireless/iwl-4965.c +4 -3
@@ -2663,7 +2663,7 @@ void iwl_hw_build_tx_cmd_rate(struct iwl_priv *priv,u8 rate;u8 rts_retry_limit =0 ;u8 data_retry_limit =0 ; -u32 tx_flags; +__le32 tx_flags; tx_flags = cmd->cmd.tx.tx_flags;
@@ -3287,7 +3287,8 @@ int iwl4965_tx_cmd(struct iwl_priv *priv, struct iwl_cmd *out_cmd, scratch_phys = txcmd_phys +sizeof (struct iwl_cmd_header ) + offsetof(struct iwl_tx_cmd , scratch); - tx->dram_lsb_ptr =iwl4965_get_dma_lo_address (scratch_phys); + tx->dram_lsb_ptr =cpu_to_le32 ( +iwl4965_get_dma_lo_address (scratch_phys)); tx->dram_msb_ptr =iwl4965_get_dma_hi_address (scratch_phys);/* Hard coded to start at the highest retry fallback position
@@ -4166,7 +4167,7 @@ static int iwl4965_tx_status_reply_compressed_ba(struct iwl_priv *priv,IWL_DEBUG_TX_REPLY ("%s ON i=%d idx=%d raw=%d\n" , ack?"ACK" :"NACK" , i, idx, agg->start_idx + i);iwl4965_set_tx_status (priv, ba_resp->tid, idx, ack,1 , - agg->rate.rate_n_flags); + agg->rate_n_flags); }
drivers/net/wireless/iwl-base.c +82 -76
381 lines not on this page · raw message
drivers/net/wireless/iwl-commands.h +44 -44
135 lines not on this page · raw message
drivers/net/wireless/iwl-hw.h +1 -1
@@ -1207,7 +1207,7 @@ struct statistics {#define IWL_TX_QUEUE_HCCA_1 5#define IWL_TX_QUEUE_HCCA_2 6 -#define U32_PAD (n) ((4-(n%4))%4) +#define U32_PAD (n) ((4-(n))&0x3)#define AC_BE_TID_MASK 0x9/* TID 0 and 3 */ #define AC_BK_TID_MASK 0x6/* TID 1 and 2 */
drivers/net/wireless/iwlwifi.h +3 -2
@@ -229,9 +229,10 @@ struct iwl_frame {#define SEQ_TO_INDEX (x) (x & 0xff)#define INDEX_TO_SEQ (x) (x & 0xff)#define SEQ_HUGE_FRAME (0x4000) -#define SEQ_RX_FRAME (0x8000) +#define SEQ_RX_FRAME __constant_cpu_to_le16(0x8000)#define SEQ_TO_SN (seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)#define SN_TO_SEQ (ssn) (((ssn) << 4 ) & IEEE80211_SCTL_SEQ) +#define MAX_SN ((IEEE80211_SCTL_SEQ) >> 4)enum {/* CMD_SIZE_NORMAL = 0, */
@@ -398,7 +399,7 @@ struct iwl_ht_agg {u16 start_idx;u32 bitmap0;u32 bitmap1; -struct iwl_rate rate; +u32 rate_n_flags; };#endif /* CONFIG_IWLWIFI_HT_AGG */ #endif /* CONFIG_IWLWIFI_HT */
Signature · 1 line
1.5.2
PATCH 7/7 iwlwifi: Endian fix for rate setting in 3945
From: Tomas Winkler <[email protected]>
This patch fixes endianity issue in rate setting in 3945.
--- drivers/net/wireless/iwl-3945-hw.h | 4 ++++ drivers/net/wireless/iwl-base.c | 13 ++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-)
drivers/net/wireless/iwl-3945-hw.h +4 -0
@@ -97,4 +97,8 @@ static inline u16 iwl_hw_get_rate_n_flags(__le16 rate_n_flags) return le16_to_cpu(rate_n_flags); } +static inline __le16 iwl_hw_set_rate_n_flags (u8 rate,u16 flags) +{ +return cpu_to_le16 ((u16 )rate|flags); +}#endif
drivers/net/wireless/iwl-base.c +8 -5
@@ -382,7 +382,9 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 * bssid, int is_ap, u8 flags)int index =IWL_INVALID_STATION ;struct iwl_station_entry *station;unsigned long flags_spin; - +#if IWL ==3945 +u8 rate; +#endif spin_lock_irqsave (&priv->sta_lock, flags_spin);if (is_ap) { index =IWL_AP_ID ;
@@ -426,14 +428,15 @@ u8 iwl_add_station(struct iwl_priv *priv, const u8 * bssid, int is_ap, u8 flags) station->sta.sta.sta_id = i; station->sta.station_flags =0 ;#if IWL ==3945 - station->sta.rate_n_flags =cpu_to_le16 ( - (priv->phymode ==MODE_IEEE80211A ) ?IWL_RATE_6M_PLCP : -IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag); + rate = (priv->phymode ==MODE_IEEE80211A ) ?IWL_RATE_6M_PLCP : +IWL_RATE_1M_PLCP | priv->hw_setting.cck_flag;/* Turn on both antennas for the station... */ - station->sta.rate_n_flags |=RATE_MCS_ANT_AB_MSK ; + station->sta.rate_n_flags = +iwl_hw_set_rate_n_flags (rate,RATE_MCS_ANT_AB_MSK ); station->sta.station_flags |=STA_FLG_TX_RATE_MSK ; + station->current_rate.rate_n_flags =le16_to_cpu ( station->sta.rate_n_flags);#endif
Signature · 1 line
1.5.2
Re: [PATCH 4/7] iwlwifi: Endainity fix for rx configuration
In reply to Zhu YiQuoted 19 lines · Zhu Yi
From: Tomas Winkler <[email protected]>
This patch fixes endianity issues in rx configuration related code.
Signed-off-by Gregory Greenman <[email protected]>Signed-off-by Tomas Winkler <[email protected]>Signed-off-by Zhu Yi <[email protected]>--- drivers/net/wireless/iwl-4965.c | 26 ++++--- drivers/net/wireless/iwl-base.c | 148 +++++++++++++++++++++------------------ drivers/net/wireless/iwl-hw.h | 10 ++-- 3 files changed, 101 insertions(+), 83 deletions(-)drivers/net/wireless/iwl-4965.c +0
-0
drivers/net/wireless/iwl-4965.c static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, · line 3619
Quoted 6 lines
drivers/net/wireless/iwl-4965.c +1
-1@@ -3615,8 +3615,8 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, hdr = (void *)(pkt->u.raw +sizeof (struct iwl4965_rx_mpdu_res_start )); - rx_end = (u32 *) (((u8 *) hdr) + amsdu->byte_count); len = amsdu->byte_count; + rx_end = (u32 *) (((u8 *) hdr) + len);
I doubt rx_end is a pointer to u32. Most likely you want to use (__le32 *) here and also audit the users of rx_end, if they need le32_to_cpu().
Re: [PATCH 4/7] iwlwifi: Endainity fix for rx configuration
Quoted 21 lines · Michael Buesch
Quoted 20 lines · Zhu Yi
From: Tomas Winkler <[email protected]>
This patch fixes endianity issues in rx configuration related code.
Signed-off-by Gregory Greenman <[email protected]>Signed-off-by Tomas Winkler <[email protected]>Signed-off-by Zhu Yi <[email protected]>--- drivers/net/wireless/iwl-4965.c | 26 ++++--- drivers/net/wireless/iwl-base.c | 148 +++++++++++++++++++++------------------ drivers/net/wireless/iwl-hw.h | 10 ++-- 3 files changed, 101 insertions(+), 83 deletions(-)drivers/net/wireless/iwl-4965.c +0
-0@@ -3615,8 +3615,8 @@ static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data,
Quoted 10 lines
drivers/net/wireless/iwl-4965.c static void iwl4965_handle_data_packet(struct iwl_priv *priv, int is_data, · line 3619
Quoted 5 lines
drivers/net/wireless/iwl-4965.c +1
-1hdr = (void *)(pkt->u.raw +sizeof (struct iwl4965_rx_mpdu_res_start )); - rx_end = (u32 *) (((u8 *) hdr) + amsdu->byte_count); len = amsdu->byte_count; + rx_end = (u32 *) (((u8 *) hdr) + len);I doubt
rx_endis a pointer to u32. Most likely you want to use (__le32*) here and also audit the users ofrx_end, if they needle32_to_cpu().
You are right. Only the len parameter was fixed. I will send another patch that fixes also the pointer.
Thanks
Tomas
Quoted 4 lines
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html