diff options
author | David S. Miller <davem@davemloft.net> | 2009-12-08 16:44:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-12-08 16:44:44 -0500 |
commit | e61444d9209821469ed0d5a9128dcf2e494533ea (patch) | |
tree | 17b406ce83e925da011d2b463ddf278b821c365d /drivers/net/wireless/rtl818x | |
parent | a252e749f1ae17e43ccc5824f7b1b5854417c98b (diff) | |
parent | 6a213afd058436dbbd01098d7422c6a0073c39b5 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rtl818x')
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187.h | 5 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_dev.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/rtl818x/rtl8187_rfkill.c | 4 |
3 files changed, 17 insertions, 4 deletions
diff --git a/drivers/net/wireless/rtl818x/rtl8187.h b/drivers/net/wireless/rtl818x/rtl8187.h index abb4907cf296..b1a24de0b7b0 100644 --- a/drivers/net/wireless/rtl818x/rtl8187.h +++ b/drivers/net/wireless/rtl818x/rtl8187.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #define RTL8187_EEPROM_TXPWR_CHAN_1 0x16 /* 3 channels */ | 23 | #define RTL8187_EEPROM_TXPWR_CHAN_1 0x16 /* 3 channels */ |
24 | #define RTL8187_EEPROM_TXPWR_CHAN_6 0x1B /* 2 channels */ | 24 | #define RTL8187_EEPROM_TXPWR_CHAN_6 0x1B /* 2 channels */ |
25 | #define RTL8187_EEPROM_TXPWR_CHAN_4 0x3D /* 2 channels */ | 25 | #define RTL8187_EEPROM_TXPWR_CHAN_4 0x3D /* 2 channels */ |
26 | #define RTL8187_EEPROM_SELECT_GPIO 0x3B | ||
26 | 27 | ||
27 | #define RTL8187_REQT_READ 0xC0 | 28 | #define RTL8187_REQT_READ 0xC0 |
28 | #define RTL8187_REQT_WRITE 0x40 | 29 | #define RTL8187_REQT_WRITE 0x40 |
@@ -31,6 +32,9 @@ | |||
31 | 32 | ||
32 | #define RTL8187_MAX_RX 0x9C4 | 33 | #define RTL8187_MAX_RX 0x9C4 |
33 | 34 | ||
35 | #define RFKILL_MASK_8187_89_97 0x2 | ||
36 | #define RFKILL_MASK_8198 0x4 | ||
37 | |||
34 | struct rtl8187_rx_info { | 38 | struct rtl8187_rx_info { |
35 | struct urb *urb; | 39 | struct urb *urb; |
36 | struct ieee80211_hw *dev; | 40 | struct ieee80211_hw *dev; |
@@ -122,6 +126,7 @@ struct rtl8187_priv { | |||
122 | u8 noise; | 126 | u8 noise; |
123 | u8 slot_time; | 127 | u8 slot_time; |
124 | u8 aifsn[4]; | 128 | u8 aifsn[4]; |
129 | u8 rfkill_mask; | ||
125 | struct { | 130 | struct { |
126 | __le64 buf; | 131 | __le64 buf; |
127 | struct sk_buff_head queue; | 132 | struct sk_buff_head queue; |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c index 76973b8c7099..bc5726dd5fe4 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_dev.c +++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c | |||
@@ -1322,6 +1322,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1322 | struct ieee80211_channel *channel; | 1322 | struct ieee80211_channel *channel; |
1323 | const char *chip_name; | 1323 | const char *chip_name; |
1324 | u16 txpwr, reg; | 1324 | u16 txpwr, reg; |
1325 | u16 product_id = le16_to_cpu(udev->descriptor.idProduct); | ||
1325 | int err, i; | 1326 | int err, i; |
1326 | 1327 | ||
1327 | dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops); | 1328 | dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops); |
@@ -1481,6 +1482,13 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1481 | (*channel++).hw_value = txpwr & 0xFF; | 1482 | (*channel++).hw_value = txpwr & 0xFF; |
1482 | (*channel++).hw_value = txpwr >> 8; | 1483 | (*channel++).hw_value = txpwr >> 8; |
1483 | } | 1484 | } |
1485 | /* Handle the differing rfkill GPIO bit in different models */ | ||
1486 | priv->rfkill_mask = RFKILL_MASK_8187_89_97; | ||
1487 | if (product_id == 0x8197 || product_id == 0x8198) { | ||
1488 | eeprom_93cx6_read(&eeprom, RTL8187_EEPROM_SELECT_GPIO, ®); | ||
1489 | if (reg & 0xFF00) | ||
1490 | priv->rfkill_mask = RFKILL_MASK_8198; | ||
1491 | } | ||
1484 | 1492 | ||
1485 | /* | 1493 | /* |
1486 | * XXX: Once this driver supports anything that requires | 1494 | * XXX: Once this driver supports anything that requires |
@@ -1509,9 +1517,9 @@ static int __devinit rtl8187_probe(struct usb_interface *intf, | |||
1509 | mutex_init(&priv->conf_mutex); | 1517 | mutex_init(&priv->conf_mutex); |
1510 | skb_queue_head_init(&priv->b_tx_status.queue); | 1518 | skb_queue_head_init(&priv->b_tx_status.queue); |
1511 | 1519 | ||
1512 | printk(KERN_INFO "%s: hwaddr %pM, %s V%d + %s\n", | 1520 | printk(KERN_INFO "%s: hwaddr %pM, %s V%d + %s, rfkill mask %d\n", |
1513 | wiphy_name(dev->wiphy), dev->wiphy->perm_addr, | 1521 | wiphy_name(dev->wiphy), dev->wiphy->perm_addr, |
1514 | chip_name, priv->asic_rev, priv->rf->name); | 1522 | chip_name, priv->asic_rev, priv->rf->name, priv->rfkill_mask); |
1515 | 1523 | ||
1516 | #ifdef CONFIG_RTL8187_LEDS | 1524 | #ifdef CONFIG_RTL8187_LEDS |
1517 | eeprom_93cx6_read(&eeprom, 0x3F, ®); | 1525 | eeprom_93cx6_read(&eeprom, 0x3F, ®); |
diff --git a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c index cad8037ab2af..03555e1e0cab 100644 --- a/drivers/net/wireless/rtl818x/rtl8187_rfkill.c +++ b/drivers/net/wireless/rtl818x/rtl8187_rfkill.c | |||
@@ -25,10 +25,10 @@ static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv) | |||
25 | u8 gpio; | 25 | u8 gpio; |
26 | 26 | ||
27 | gpio = rtl818x_ioread8(priv, &priv->map->GPIO0); | 27 | gpio = rtl818x_ioread8(priv, &priv->map->GPIO0); |
28 | rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~0x02); | 28 | rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~priv->rfkill_mask); |
29 | gpio = rtl818x_ioread8(priv, &priv->map->GPIO1); | 29 | gpio = rtl818x_ioread8(priv, &priv->map->GPIO1); |
30 | 30 | ||
31 | return gpio & 0x02; | 31 | return gpio & priv->rfkill_mask; |
32 | } | 32 | } |
33 | 33 | ||
34 | void rtl8187_rfkill_init(struct ieee80211_hw *hw) | 34 | void rtl8187_rfkill_init(struct ieee80211_hw *hw) |