Skip to content

Commit

Permalink
rtl8187: use SET_IEEE80211_PERM_ADDR
Browse files Browse the repository at this point in the history
Signed-off-by: John W. Linville <[email protected]>
Acked-by: Hin-Tak Leung <[email protected]>
  • Loading branch information
linvjw committed May 5, 2010
1 parent c693bf9 commit f2c9838
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/net/wireless/rtl818x/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -1332,6 +1332,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
u16 txpwr, reg;
u16 product_id = le16_to_cpu(udev->descriptor.idProduct);
int err, i;
u8 mac_addr[ETH_ALEN];

dev = ieee80211_alloc_hw(sizeof(*priv), &rtl8187_ops);
if (!dev) {
Expand Down Expand Up @@ -1389,12 +1390,13 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
udelay(10);

eeprom_93cx6_multiread(&eeprom, RTL8187_EEPROM_MAC_ADDR,
(__le16 __force *)dev->wiphy->perm_addr, 3);
if (!is_valid_ether_addr(dev->wiphy->perm_addr)) {
(__le16 __force *)mac_addr, 3);
if (!is_valid_ether_addr(mac_addr)) {
printk(KERN_WARNING "rtl8187: Invalid hwaddr! Using randomly "
"generated MAC address\n");
random_ether_addr(dev->wiphy->perm_addr);
random_ether_addr(mac_addr);
}
SET_IEEE80211_PERM_ADDR(dev, mac_addr);

channel = priv->channels;
for (i = 0; i < 3; i++) {
Expand Down Expand Up @@ -1525,7 +1527,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
skb_queue_head_init(&priv->b_tx_status.queue);

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

#ifdef CONFIG_RTL8187_LEDS
Expand Down

0 comments on commit f2c9838

Please sign in to comment.