aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl3945-base.c
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-02-18 18:54:26 -0500
committerJohn W. Linville <linville@tuxdriver.com>2009-02-27 14:52:45 -0500
commitcade0eb2c7c7b8df60ac54409592c1a23e3220c8 (patch)
tree1de19db03d13ed926794c5d0759c1b4e0cc08a8a /drivers/net/wireless/iwlwifi/iwl3945-base.c
parent2ce4f9d8618b84994b19e0a31a56562863666623 (diff)
iwl3945: use iwl_rx_scan handlers
Patch makes use of iwl_rx_scan handler for 3945. 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>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl3945-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c128
1 files changed, 1 insertions, 127 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index cb40e431415f..2ad4d760ad2d 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -1518,127 +1518,6 @@ static void iwl3945_rx_beacon_notif(struct iwl_priv *priv,
1518 queue_work(priv->workqueue, &priv->beacon_update); 1518 queue_work(priv->workqueue, &priv->beacon_update);
1519} 1519}
1520 1520
1521/* Service response to REPLY_SCAN_CMD (0x80) */
1522static void iwl3945_rx_reply_scan(struct iwl_priv *priv,
1523 struct iwl_rx_mem_buffer *rxb)
1524{
1525#ifdef CONFIG_IWLWIFI_DEBUG
1526 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1527 struct iwl_scanreq_notification *notif =
1528 (struct iwl_scanreq_notification *)pkt->u.raw;
1529
1530 IWL_DEBUG_RX(priv, "Scan request status = 0x%x\n", notif->status);
1531#endif
1532}
1533
1534/* Service SCAN_START_NOTIFICATION (0x82) */
1535static void iwl3945_rx_scan_start_notif(struct iwl_priv *priv,
1536 struct iwl_rx_mem_buffer *rxb)
1537{
1538 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1539 struct iwl_scanstart_notification *notif =
1540 (struct iwl_scanstart_notification *)pkt->u.raw;
1541 priv->scan_start_tsf = le32_to_cpu(notif->tsf_low);
1542 IWL_DEBUG_SCAN(priv, "Scan start: "
1543 "%d [802.11%s] "
1544 "(TSF: 0x%08X:%08X) - %d (beacon timer %u)\n",
1545 notif->channel,
1546 notif->band ? "bg" : "a",
1547 notif->tsf_high,
1548 notif->tsf_low, notif->status, notif->beacon_timer);
1549}
1550
1551/* Service SCAN_RESULTS_NOTIFICATION (0x83) */
1552static void iwl3945_rx_scan_results_notif(struct iwl_priv *priv,
1553 struct iwl_rx_mem_buffer *rxb)
1554{
1555#ifdef CONFIG_IWLWIFI_DEBUG
1556 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1557 struct iwl_scanresults_notification *notif =
1558 (struct iwl_scanresults_notification *)pkt->u.raw;
1559#endif
1560
1561 IWL_DEBUG_SCAN(priv, "Scan ch.res: "
1562 "%d [802.11%s] "
1563 "(TSF: 0x%08X:%08X) - %d "
1564 "elapsed=%lu usec (%dms since last)\n",
1565 notif->channel,
1566 notif->band ? "bg" : "a",
1567 le32_to_cpu(notif->tsf_high),
1568 le32_to_cpu(notif->tsf_low),
1569 le32_to_cpu(notif->statistics[0]),
1570 le32_to_cpu(notif->tsf_low) - priv->scan_start_tsf,
1571 jiffies_to_msecs(elapsed_jiffies
1572 (priv->last_scan_jiffies, jiffies)));
1573
1574 priv->last_scan_jiffies = jiffies;
1575 priv->next_scan_jiffies = 0;
1576}
1577
1578/* Service SCAN_COMPLETE_NOTIFICATION (0x84) */
1579static void iwl3945_rx_scan_complete_notif(struct iwl_priv *priv,
1580 struct iwl_rx_mem_buffer *rxb)
1581{
1582#ifdef CONFIG_IWLWIFI_DEBUG
1583 struct iwl_rx_packet *pkt = (void *)rxb->skb->data;
1584 struct iwl_scancomplete_notification *scan_notif = (void *)pkt->u.raw;
1585#endif
1586
1587 IWL_DEBUG_SCAN(priv, "Scan complete: %d channels (TSF 0x%08X:%08X) - %d\n",
1588 scan_notif->scanned_channels,
1589 scan_notif->tsf_low,
1590 scan_notif->tsf_high, scan_notif->status);
1591
1592 /* The HW is no longer scanning */
1593 clear_bit(STATUS_SCAN_HW, &priv->status);
1594
1595 /* The scan completion notification came in, so kill that timer... */
1596 cancel_delayed_work(&priv->scan_check);
1597
1598 IWL_DEBUG_INFO(priv, "Scan pass on %sGHz took %dms\n",
1599 (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ)) ?
1600 "2.4" : "5.2",
1601 jiffies_to_msecs(elapsed_jiffies
1602 (priv->scan_pass_start, jiffies)));
1603
1604 /* Remove this scanned band from the list of pending
1605 * bands to scan, band G precedes A in order of scanning
1606 * as seen in iwl3945_bg_request_scan */
1607 if (priv->scan_bands & BIT(IEEE80211_BAND_2GHZ))
1608 priv->scan_bands &= ~BIT(IEEE80211_BAND_2GHZ);
1609 else if (priv->scan_bands & BIT(IEEE80211_BAND_5GHZ))
1610 priv->scan_bands &= ~BIT(IEEE80211_BAND_5GHZ);
1611
1612 /* If a request to abort was given, or the scan did not succeed
1613 * then we reset the scan state machine and terminate,
1614 * re-queuing another scan if one has been requested */
1615 if (test_bit(STATUS_SCAN_ABORTING, &priv->status)) {
1616 IWL_DEBUG_INFO(priv, "Aborted scan completed.\n");
1617 clear_bit(STATUS_SCAN_ABORTING, &priv->status);
1618 } else {
1619 /* If there are more bands on this scan pass reschedule */
1620 if (priv->scan_bands > 0)
1621 goto reschedule;
1622 }
1623
1624 priv->last_scan_jiffies = jiffies;
1625 priv->next_scan_jiffies = 0;
1626 IWL_DEBUG_INFO(priv, "Setting scan to off\n");
1627
1628 clear_bit(STATUS_SCANNING, &priv->status);
1629
1630 IWL_DEBUG_INFO(priv, "Scan took %dms\n",
1631 jiffies_to_msecs(elapsed_jiffies(priv->scan_start, jiffies)));
1632
1633 queue_work(priv->workqueue, &priv->scan_completed);
1634
1635 return;
1636
1637reschedule:
1638 priv->scan_pass_start = jiffies;
1639 queue_work(priv->workqueue, &priv->request_scan);
1640}
1641
1642/* Handle notification from uCode that card's power state is changing 1521/* Handle notification from uCode that card's power state is changing
1643 * due to software, hardware, or critical temperature RFKILL */ 1522 * due to software, hardware, or critical temperature RFKILL */
1644static void iwl3945_rx_card_state_notif(struct iwl_priv *priv, 1523static void iwl3945_rx_card_state_notif(struct iwl_priv *priv,
@@ -1707,12 +1586,7 @@ static void iwl3945_setup_rx_handlers(struct iwl_priv *priv)
1707 priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics; 1586 priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl3945_hw_rx_statistics;
1708 priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics; 1587 priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl3945_hw_rx_statistics;
1709 1588
1710 priv->rx_handlers[REPLY_SCAN_CMD] = iwl3945_rx_reply_scan; 1589 iwl_setup_rx_scan_handlers(priv);
1711 priv->rx_handlers[SCAN_START_NOTIFICATION] = iwl3945_rx_scan_start_notif;
1712 priv->rx_handlers[SCAN_RESULTS_NOTIFICATION] =
1713 iwl3945_rx_scan_results_notif;
1714 priv->rx_handlers[SCAN_COMPLETE_NOTIFICATION] =
1715 iwl3945_rx_scan_complete_notif;
1716 priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif; 1590 priv->rx_handlers[CARD_STATE_NOTIFICATION] = iwl3945_rx_card_state_notif;
1717 1591
1718 /* Set up hardware specific Rx handlers */ 1592 /* Set up hardware specific Rx handlers */