Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 175517
b: refs/heads/master
c: 70d5713
h: refs/heads/master
i:
  175515: 6fd76de
v: v3
  • Loading branch information
Larry Finger authored and John W. Linville committed Dec 7, 2009
1 parent 3f3977e commit a93d9e1
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 815833e7ecf0b9a017315cae6aef4d7cd9517681
refs/heads/master: 70d57139f932b9ca21026253d02af71cf53d764a
5 changes: 5 additions & 0 deletions trunk/drivers/net/wireless/rtl818x/rtl8187.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#define RTL8187_EEPROM_TXPWR_CHAN_1 0x16 /* 3 channels */
#define RTL8187_EEPROM_TXPWR_CHAN_6 0x1B /* 2 channels */
#define RTL8187_EEPROM_TXPWR_CHAN_4 0x3D /* 2 channels */
#define RTL8187_EEPROM_SELECT_GPIO 0x3B

#define RTL8187_REQT_READ 0xC0
#define RTL8187_REQT_WRITE 0x40
Expand All @@ -31,6 +32,9 @@

#define RTL8187_MAX_RX 0x9C4

#define RFKILL_MASK_8187_89_97 0x2
#define RFKILL_MASK_8198 0x4

struct rtl8187_rx_info {
struct urb *urb;
struct ieee80211_hw *dev;
Expand Down Expand Up @@ -122,6 +126,7 @@ struct rtl8187_priv {
u8 noise;
u8 slot_time;
u8 aifsn[4];
u8 rfkill_mask;
struct {
__le64 buf;
struct sk_buff_head queue;
Expand Down
12 changes: 10 additions & 2 deletions trunk/drivers/net/wireless/rtl818x/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
struct ieee80211_channel *channel;
const char *chip_name;
u16 txpwr, reg;
u16 product_id = le16_to_cpu(udev->descriptor.idProduct);
int err, i;

dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops);
Expand Down Expand Up @@ -1481,6 +1482,13 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
(*channel++).hw_value = txpwr & 0xFF;
(*channel++).hw_value = txpwr >> 8;
}
/* Handle the differing rfkill GPIO bit in different models */
priv->rfkill_mask = RFKILL_MASK_8187_89_97;
if (product_id == 0x8197 || product_id == 0x8198) {
eeprom_93cx6_read(&eeprom, RTL8187_EEPROM_SELECT_GPIO, &reg);
if (reg & 0xFF00)
priv->rfkill_mask = RFKILL_MASK_8198;
}

/*
* XXX: Once this driver supports anything that requires
Expand Down Expand Up @@ -1509,9 +1517,9 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
mutex_init(&priv->conf_mutex);
skb_queue_head_init(&priv->b_tx_status.queue);

printk(KERN_INFO "%s: hwaddr %pM, %s V%d + %s\n",
printk(KERN_INFO "%s: hwaddr %pM, %s V%d + %s, rfkill mask %d\n",
wiphy_name(dev->wiphy), dev->wiphy->perm_addr,
chip_name, priv->asic_rev, priv->rf->name);
chip_name, priv->asic_rev, priv->rf->name, priv->rfkill_mask);

#ifdef CONFIG_RTL8187_LEDS
eeprom_93cx6_read(&eeprom, 0x3F, &reg);
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/net/wireless/rtl818x/rtl8187_rfkill.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ static bool rtl8187_is_radio_enabled(struct rtl8187_priv *priv)
u8 gpio;

gpio = rtl818x_ioread8(priv, &priv->map->GPIO0);
rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~0x02);
rtl818x_iowrite8(priv, &priv->map->GPIO0, gpio & ~priv->rfkill_mask);
gpio = rtl818x_ioread8(priv, &priv->map->GPIO1);

return gpio & 0x02;
return gpio & priv->rfkill_mask;
}

void rtl8187_rfkill_init(struct ieee80211_hw *hw)
Expand Down

0 comments on commit a93d9e1

Please sign in to comment.