aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-02-18 18:54:29 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:45 -0500
commit261b9c33987ca80bf6217848c3c113d2a4d313d0 (patch)
treea925bd6ecbda4eb3b70ed1809afcfe9e07bfb69e
parent030f05eda6ee4d0ed63a93f4f9ebae42c46fb8b6 (diff)
iwl3945: use iwl_rx_reply_error notification
Patch removes duplicate code from iwl3945 and uses iwl_rx_reply_error and spectrum notifications from iwlwifi. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c37
4 files changed, 20 insertions, 49 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 0928b890ee7c..8eaaf2a7ceac 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -754,20 +754,6 @@ static void iwl_rx_reply_alive(struct iwl_priv *priv,
754 IWL_WARN(priv, "uCode did not respond OK.\n"); 754 IWL_WARN(priv, "uCode did not respond OK.\n");
755} 755}
756 756
757static void iwl_rx_reply_error(struct iwl_priv *priv,
758 struct iwl_rx_mem_buffer *rxb)
759{
760 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
761
762 IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
763 "seq 0x%04X ser 0x%08X\n",
764 le32_to_cpu(pkt->u.err_resp.error_type),
765 get_cmd_string(pkt->u.err_resp.cmd_id),
766 pkt->u.err_resp.cmd_id,
767 le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
768 le32_to_cpu(pkt->u.err_resp.error_info));
769}
770
771static void iwl_bg_beacon_update(struct work_struct *work) 757static void iwl_bg_beacon_update(struct work_struct *work)
772{ 758{
773 struct iwl_priv *priv = 759 struct iwl_priv *priv =
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 7a2c695057e3..61b9902ee327 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2002,3 +2002,19 @@ void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
2002 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len)); 2002 iwl_print_hex_dump(priv, IWL_DL_RADIO, pkt->u.raw, le32_to_cpu(pkt->len));
2003} 2003}
2004EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif); 2004EXPORT_SYMBOL(iwl_rx_pm_debug_statistics_notif);
2005
2006void iwl_rx_reply_error(struct iwl_priv *priv,
2007 struct iwl_rx_mem_buffer *rxb)
2008{
2009 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
2010
2011 IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
2012 "seq 0x%04X ser 0x%08X\n",
2013 le32_to_cpu(pkt->u.err_resp.error_type),
2014 get_cmd_string(pkt->u.err_resp.cmd_id),
2015 pkt->u.err_resp.cmd_id,
2016 le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
2017 le32_to_cpu(pkt->u.err_resp.error_info));
2018}
2019EXPORT_SYMBOL(iwl_rx_reply_error);
2020
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 8ecbe4bc8fa0..f2f75d1a7dc1 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -256,6 +256,8 @@ void iwl_rx_pm_sleep_notif(struct iwl_priv *priv,
256 struct iwl_rx_mem_buffer *rxb); 256 struct iwl_rx_mem_buffer *rxb);
257void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv, 257void iwl_rx_pm_debug_statistics_notif(struct iwl_priv *priv,
258 struct iwl_rx_mem_buffer *rxb); 258 struct iwl_rx_mem_buffer *rxb);
259void iwl_rx_reply_error(struct iwl_priv *priv,
260 struct iwl_rx_mem_buffer *rxb);
259 261
260/***************************************************** 262/*****************************************************
261* RX 263* RX
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index abb9cd39bcda..5c0e0a48e6bf 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1385,38 +1385,6 @@ static void iwl3945_rx_reply_add_sta(struct iwl_priv *priv,
1385 return; 1385 return;
1386} 1386}
1387 1387
1388static void iwl3945_rx_reply_error(struct iwl_priv *priv,
1389 struct iwl_rx_mem_buffer *rxb)
1390{
1391 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1392
1393 IWL_ERR(priv, "Error Reply type 0x%08X cmd %s (0x%02X) "
1394 "seq 0x%04X ser 0x%08X\n",
1395 le32_to_cpu(pkt->u.err_resp.error_type),
1396 get_cmd_string(pkt->u.err_resp.cmd_id),
1397 pkt->u.err_resp.cmd_id,
1398 le16_to_cpu(pkt->u.err_resp.bad_cmd_seq_num),
1399 le32_to_cpu(pkt->u.err_resp.error_info));
1400}
1401
1402static void iwl3945_rx_spectrum_measure_notif(struct iwl_priv *priv,
1403 struct iwl_rx_mem_buffer *rxb)
1404{
1405#ifdef CONFIG_IWL3945_SPECTRUM_MEASUREMENT
1406 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1407 struct iwl_spectrum_notification *report = &(pkt->u.spectrum_notif);
1408
1409 if (!report->state) {
1410 IWL_DEBUG(priv, IWL_DL_11H | IWL_DL_INFO,
1411 "Spectrum Measure Notification: Start\n");
1412 return;
1413 }
1414
1415 memcpy(&priv->measure_report, report, sizeof(*report));
1416 priv->measurement_status |= MEASUREMENT_READY;
1417#endif
1418}
1419
1420static void iwl3945_bg_beacon_update(struct work_struct *work) 1388static void iwl3945_bg_beacon_update(struct work_struct *work)
1421{ 1389{
1422 struct iwl_priv *priv = 1390 struct iwl_priv *priv =
@@ -1515,10 +1483,8 @@ static void iwl3945_setup_rx_handlers(struct iwl_priv *priv)
1515{ 1483{
1516 priv->rx_handlers[REPLY_ALIVE] = iwl3945_rx_reply_alive; 1484 priv->rx_handlers[REPLY_ALIVE] = iwl3945_rx_reply_alive;
1517 priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta; 1485 priv->rx_handlers[REPLY_ADD_STA] = iwl3945_rx_reply_add_sta;
1518 priv->rx_handlers[REPLY_ERROR] = iwl3945_rx_reply_error; 1486 priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error;
1519 priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; 1487 priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa;
1520 priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] =
1521 iwl3945_rx_spectrum_measure_notif;
1522 priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; 1488 priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif;
1523 priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = 1489 priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] =
1524 iwl_rx_pm_debug_statistics_notif; 1490 iwl_rx_pm_debug_statistics_notif;
@@ -1532,6 +1498,7 @@ static void iwl3945_setup_rx_handlers(struct iwl_priv *priv)
1532 priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics; 1498 priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics;
1533 priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics; 1499 priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics;
1534 1500
1501 iwl_setup_spectrum_handlers(priv);
1535 iwl_setup_rx_scan_handlers(priv); 1502 iwl_setup_rx_scan_handlers(priv);
1536 priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif; 1503 priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif;
1537 1504