aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath9k
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/ath9k')
-rw-r--r--drivers/net/wireless/ath9k/hw.c3
-rw-r--r--drivers/net/wireless/ath9k/main.c74
-rw-r--r--drivers/net/wireless/ath9k/rc.c6
-rw-r--r--drivers/net/wireless/ath9k/recv.c5
4 files changed, 75 insertions, 13 deletions
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c
index e05c9ef55e47..ff6457e0cb00 100644
--- a/drivers/net/wireless/ath9k/hw.c
+++ b/drivers/net/wireless/ath9k/hw.c
@@ -382,8 +382,9 @@ static const char *ath9k_hw_devname(u16 devid)
382{ 382{
383 switch (devid) { 383 switch (devid) {
384 case AR5416_DEVID_PCI: 384 case AR5416_DEVID_PCI:
385 case AR5416_DEVID_PCIE:
386 return "Atheros 5416"; 385 return "Atheros 5416";
386 case AR5416_DEVID_PCIE:
387 return "Atheros 5418";
387 case AR9160_DEVID_PCI: 388 case AR9160_DEVID_PCI:
388 return "Atheros 9160"; 389 return "Atheros 9160";
389 case AR9280_DEVID_PCI: 390 case AR9280_DEVID_PCI:
diff --git a/drivers/net/wireless/ath9k/main.c b/drivers/net/wireless/ath9k/main.c
index f830fe1e4adc..fbb2dd2373c8 100644
--- a/drivers/net/wireless/ath9k/main.c
+++ b/drivers/net/wireless/ath9k/main.c
@@ -18,6 +18,7 @@
18 18
19#include <linux/nl80211.h> 19#include <linux/nl80211.h>
20#include "core.h" 20#include "core.h"
21#include "reg.h"
21 22
22#define ATH_PCI_VERSION "0.1" 23#define ATH_PCI_VERSION "0.1"
23 24
@@ -1519,15 +1520,74 @@ static struct ieee80211_ops ath9k_ops = {
1519 .set_frag_threshold = ath9k_no_fragmentation, 1520 .set_frag_threshold = ath9k_no_fragmentation,
1520}; 1521};
1521 1522
1523static struct {
1524 u32 version;
1525 const char * name;
1526} ath_mac_bb_names[] = {
1527 { AR_SREV_VERSION_5416_PCI, "5416" },
1528 { AR_SREV_VERSION_5416_PCIE, "5418" },
1529 { AR_SREV_VERSION_9100, "9100" },
1530 { AR_SREV_VERSION_9160, "9160" },
1531 { AR_SREV_VERSION_9280, "9280" },
1532 { AR_SREV_VERSION_9285, "9285" }
1533};
1534
1535static struct {
1536 u16 version;
1537 const char * name;
1538} ath_rf_names[] = {
1539 { 0, "5133" },
1540 { AR_RAD5133_SREV_MAJOR, "5133" },
1541 { AR_RAD5122_SREV_MAJOR, "5122" },
1542 { AR_RAD2133_SREV_MAJOR, "2133" },
1543 { AR_RAD2122_SREV_MAJOR, "2122" }
1544};
1545
1546/*
1547 * Return the MAC/BB name. "????" is returned if the MAC/BB is unknown.
1548 */
1549
1550static const char *
1551ath_mac_bb_name(u32 mac_bb_version)
1552{
1553 int i;
1554
1555 for (i=0; i<ARRAY_SIZE(ath_mac_bb_names); i++) {
1556 if (ath_mac_bb_names[i].version == mac_bb_version) {
1557 return ath_mac_bb_names[i].name;
1558 }
1559 }
1560
1561 return "????";
1562}
1563
1564/*
1565 * Return the RF name. "????" is returned if the RF is unknown.
1566 */
1567
1568static const char *
1569ath_rf_name(u16 rf_version)
1570{
1571 int i;
1572
1573 for (i=0; i<ARRAY_SIZE(ath_rf_names); i++) {
1574 if (ath_rf_names[i].version == rf_version) {
1575 return ath_rf_names[i].name;
1576 }
1577 }
1578
1579 return "????";
1580}
1581
1522static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1582static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1523{ 1583{
1524 void __iomem *mem; 1584 void __iomem *mem;
1525 struct ath_softc *sc; 1585 struct ath_softc *sc;
1526 struct ieee80211_hw *hw; 1586 struct ieee80211_hw *hw;
1527 const char *athname;
1528 u8 csz; 1587 u8 csz;
1529 u32 val; 1588 u32 val;
1530 int ret = 0; 1589 int ret = 0;
1590 struct ath_hal *ah;
1531 1591
1532 if (pci_enable_device(pdev)) 1592 if (pci_enable_device(pdev))
1533 return -EIO; 1593 return -EIO;
@@ -1614,11 +1674,15 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1614 goto bad4; 1674 goto bad4;
1615 } 1675 }
1616 1676
1617 athname = ath9k_hw_probe(id->vendor, id->device); 1677 ah = sc->sc_ah;
1618 1678 printk(KERN_INFO
1619 printk(KERN_INFO "%s: %s: mem=0x%lx, irq=%d\n", 1679 "%s: Atheros AR%s MAC/BB Rev:%x "
1680 "AR%s RF Rev:%x: mem=0x%lx, irq=%d\n",
1620 wiphy_name(hw->wiphy), 1681 wiphy_name(hw->wiphy),
1621 athname ? athname : "Atheros ???", 1682 ath_mac_bb_name(ah->ah_macVersion),
1683 ah->ah_macRev,
1684 ath_rf_name((ah->ah_analog5GhzRev & AR_RADIO_SREV_MAJOR)),
1685 ah->ah_phyRev,
1622 (unsigned long)mem, pdev->irq); 1686 (unsigned long)mem, pdev->irq);
1623 1687
1624 return 0; 1688 return 0;
diff --git a/drivers/net/wireless/ath9k/rc.c b/drivers/net/wireless/ath9k/rc.c
index aa6bfd717c20..517992d14808 100644
--- a/drivers/net/wireless/ath9k/rc.c
+++ b/drivers/net/wireless/ath9k/rc.c
@@ -1272,8 +1272,7 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1272 rate_ctrl->state[tx_rate].per = 100; 1272 rate_ctrl->state[tx_rate].per = 100;
1273 } else { 1273 } else {
1274 /* xretries == 2 */ 1274 /* xretries == 2 */
1275 count = sizeof(nretry_to_per_lookup) / 1275 count = ARRAY_SIZE(nretry_to_per_lookup);
1276 sizeof(nretry_to_per_lookup[0]);
1277 if (retries >= count) 1276 if (retries >= count)
1278 retries = count - 1; 1277 retries = count - 1;
1279 /* new_PER = 7/8*old_PER + 1/8*(currentPER) */ 1278 /* new_PER = 7/8*old_PER + 1/8*(currentPER) */
@@ -1291,8 +1290,7 @@ static void ath_rc_update_ht(struct ath_softc *sc,
1291 } else { /* xretries == 0 */ 1290 } else { /* xretries == 0 */
1292 /* Update the PER. */ 1291 /* Update the PER. */
1293 /* Make sure it doesn't index out of array's bounds. */ 1292 /* Make sure it doesn't index out of array's bounds. */
1294 count = sizeof(nretry_to_per_lookup) / 1293 count = ARRAY_SIZE(nretry_to_per_lookup);
1295 sizeof(nretry_to_per_lookup[0]);
1296 if (retries >= count) 1294 if (retries >= count)
1297 retries = count - 1; 1295 retries = count - 1;
1298 if (info_priv->n_bad_frames) { 1296 if (info_priv->n_bad_frames) {
diff --git a/drivers/net/wireless/ath9k/recv.c b/drivers/net/wireless/ath9k/recv.c
index 2ecb0a010ce2..2d72ac19fada 100644
--- a/drivers/net/wireless/ath9k/recv.c
+++ b/drivers/net/wireless/ath9k/recv.c
@@ -296,9 +296,8 @@ u32 ath_calcrxfilter(struct ath_softc *sc)
296 rfilt &= ~ATH9K_RX_FILTER_UCAST; 296 rfilt &= ~ATH9K_RX_FILTER_UCAST;
297 } 297 }
298 298
299 if (((sc->sc_ah->ah_opmode == ATH9K_M_STA) && 299 if (sc->sc_ah->ah_opmode == ATH9K_M_STA ||
300 (sc->rx_filter & FIF_BCN_PRBRESP_PROMISC)) || 300 sc->sc_ah->ah_opmode == ATH9K_M_IBSS)
301 (sc->sc_ah->ah_opmode == ATH9K_M_IBSS))
302 rfilt |= ATH9K_RX_FILTER_BEACON; 301 rfilt |= ATH9K_RX_FILTER_BEACON;
303 302
304 /* If in HOSTAP mode, want to enable reception of PSPOLL frames 303 /* If in HOSTAP mode, want to enable reception of PSPOLL frames