aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-4965.c
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-06-11 17:21:56 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:12 -0400
commitfd7c8a40b2a63863f749e4d17f0d94d2e5ab1331 (patch)
tree098e07d68b4d1e7a6c02750db480204c0dd469d5 /drivers/net/wireless/iwlwifi/iwl-4965.c
parente36cfdc9b17fa64245ee6206287e5120e59bbfca (diff)
mac80211: add helpers for frame control testing
A few general categories: 1) ieee80211_has_* tests if particular fctl bits are set, the helpers are de in the same order as the fctl defines: A combined _has_a4 was also added to test when both FROMDS and TODS are set. 2) ieee80211_is_* is meant to test whether the frame control is of a certain ftype - data, mgmt, ctl, and two special helpers _is_data_qos, _is_data_pres which also test a subset of the stype space. When testing for a particular stype applicable only to one ftype, functions like ieee80211_is_ack have been added. Note that the ftype is also being checked in these helpers. They have been added for all mgmt and ctl stypes in the same order as the STYPE defines. 3) ieee80211_get_* is meant to take a struct ieee80211_hdr * and returns a pointer to somewhere in the struct, see get_SA, get_DA, get_qos_ctl. The intel wireless drivers had helpers that used this namespace, convert the all to use the new helpers and remove the byteshifting as they were defined in cpu-order rather than little-endian. Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-4965.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index df345cb6fd7d..ab5027345a01 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -2388,7 +2388,7 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2388 u32 print_dump = 0; /* set to 1 to dump all frames' contents */ 2388 u32 print_dump = 0; /* set to 1 to dump all frames' contents */
2389 u32 hundred = 0; 2389 u32 hundred = 0;
2390 u32 dataframe = 0; 2390 u32 dataframe = 0;
2391 u16 fc; 2391 __le16 fc;
2392 u16 seq_ctl; 2392 u16 seq_ctl;
2393 u16 channel; 2393 u16 channel;
2394 u16 phy_flags; 2394 u16 phy_flags;
@@ -2411,7 +2411,7 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2411 return; 2411 return;
2412 2412
2413 /* MAC header */ 2413 /* MAC header */
2414 fc = le16_to_cpu(header->frame_control); 2414 fc = header->frame_control;
2415 seq_ctl = le16_to_cpu(header->seq_ctrl); 2415 seq_ctl = le16_to_cpu(header->seq_ctrl);
2416 2416
2417 /* metadata */ 2417 /* metadata */
@@ -2436,8 +2436,8 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2436 2436
2437 /* if data frame is to us and all is good, 2437 /* if data frame is to us and all is good,
2438 * (optionally) print summary for only 1 out of every 100 */ 2438 * (optionally) print summary for only 1 out of every 100 */
2439 if (to_us && (fc & ~IEEE80211_FCTL_PROTECTED) == 2439 if (to_us && (fc & ~cpu_to_le16(IEEE80211_FCTL_PROTECTED)) ==
2440 (IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) { 2440 cpu_to_le16(IEEE80211_FCTL_FROMDS | IEEE80211_FTYPE_DATA)) {
2441 dataframe = 1; 2441 dataframe = 1;
2442 if (!group100) 2442 if (!group100)
2443 print_summary = 1; /* print each frame */ 2443 print_summary = 1; /* print each frame */
@@ -2461,13 +2461,13 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2461 2461
2462 if (hundred) 2462 if (hundred)
2463 title = "100Frames"; 2463 title = "100Frames";
2464 else if (fc & IEEE80211_FCTL_RETRY) 2464 else if (ieee80211_has_retry(fc))
2465 title = "Retry"; 2465 title = "Retry";
2466 else if (ieee80211_is_assoc_response(fc)) 2466 else if (ieee80211_is_assoc_resp(fc))
2467 title = "AscRsp"; 2467 title = "AscRsp";
2468 else if (ieee80211_is_reassoc_response(fc)) 2468 else if (ieee80211_is_reassoc_resp(fc))
2469 title = "RasRsp"; 2469 title = "RasRsp";
2470 else if (ieee80211_is_probe_response(fc)) { 2470 else if (ieee80211_is_probe_resp(fc)) {
2471 title = "PrbRsp"; 2471 title = "PrbRsp";
2472 print_dump = 1; /* dump frame contents */ 2472 print_dump = 1; /* dump frame contents */
2473 } else if (ieee80211_is_beacon(fc)) { 2473 } else if (ieee80211_is_beacon(fc)) {
@@ -2496,14 +2496,14 @@ static void iwl4965_dbg_report_frame(struct iwl_priv *priv,
2496 if (dataframe) 2496 if (dataframe)
2497 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, " 2497 IWL_DEBUG_RX("%s: mhd=0x%04x, dst=0x%02x, "
2498 "len=%u, rssi=%d, chnl=%d, rate=%u, \n", 2498 "len=%u, rssi=%d, chnl=%d, rate=%u, \n",
2499 title, fc, header->addr1[5], 2499 title, le16_to_cpu(fc), header->addr1[5],
2500 length, rssi, channel, bitrate); 2500 length, rssi, channel, bitrate);
2501 else { 2501 else {
2502 /* src/dst addresses assume managed mode */ 2502 /* src/dst addresses assume managed mode */
2503 IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, " 2503 IWL_DEBUG_RX("%s: 0x%04x, dst=0x%02x, "
2504 "src=0x%02x, rssi=%u, tim=%lu usec, " 2504 "src=0x%02x, rssi=%u, tim=%lu usec, "
2505 "phy=0x%02x, chnl=%d\n", 2505 "phy=0x%02x, chnl=%d\n",
2506 title, fc, header->addr1[5], 2506 title, le16_to_cpu(fc), header->addr1[5],
2507 header->addr3[5], rssi, 2507 header->addr3[5], rssi,
2508 tsf_low - priv->scan_start_tsf, 2508 tsf_low - priv->scan_start_tsf,
2509 phy_flags, channel); 2509 phy_flags, channel);
@@ -3219,7 +3219,7 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
3219 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0]; 3219 struct iwl4965_tx_resp *tx_resp = (void *)&pkt->u.raw[0];
3220 u32 status = le32_to_cpu(tx_resp->u.status); 3220 u32 status = le32_to_cpu(tx_resp->u.status);
3221 int tid = MAX_TID_COUNT, sta_id = IWL_INVALID_STATION; 3221 int tid = MAX_TID_COUNT, sta_id = IWL_INVALID_STATION;
3222 u16 fc; 3222 __le16 fc;
3223 struct ieee80211_hdr *hdr; 3223 struct ieee80211_hdr *hdr;
3224 u8 *qc = NULL; 3224 u8 *qc = NULL;
3225 3225
@@ -3235,9 +3235,9 @@ static void iwl4965_rx_reply_tx(struct iwl_priv *priv,
3235 memset(&info->status, 0, sizeof(info->status)); 3235 memset(&info->status, 0, sizeof(info->status));
3236 3236
3237 hdr = iwl_tx_queue_get_hdr(priv, txq_id, index); 3237 hdr = iwl_tx_queue_get_hdr(priv, txq_id, index);
3238 fc = le16_to_cpu(hdr->frame_control); 3238 fc = hdr->frame_control;
3239 if (ieee80211_is_qos_data(fc)) { 3239 if (ieee80211_is_data_qos(fc)) {
3240 qc = ieee80211_get_qos_ctrl(hdr, ieee80211_get_hdrlen(fc)); 3240 qc = ieee80211_get_qos_ctl(hdr);
3241 tid = qc[0] & 0xf; 3241 tid = qc[0] & 0xf;
3242 } 3242 }
3243 3243