Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 134254
b: refs/heads/master
c: f65b56d
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and John W. Linville committed Jan 29, 2009
1 parent 04aca5d commit e6ab327
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 35 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: f55d4517ebdd6de627d42a24baefaeb689978087
refs/heads/master: f65b56d67b48eec7ffe174f223e98db58c3bf2b5
66 changes: 32 additions & 34 deletions trunk/drivers/net/wireless/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -2734,35 +2734,14 @@ static void airo_networks_initialize(struct airo_info *ai)
&ai->network_free_list);
}

static int airo_test_wpa_capable(struct airo_info *ai)
{
int status;
CapabilityRid cap_rid;

status = readCapabilityRid(ai, &cap_rid, 1);
if (status != SUCCESS) return 0;

/* Only firmware versions 5.30.17 or better can do WPA */
if (le16_to_cpu(cap_rid.softVer) > 0x530
|| (le16_to_cpu(cap_rid.softVer) == 0x530
&& le16_to_cpu(cap_rid.softSubVer) >= 17)) {
airo_print_info("", "WPA is supported.");
return 1;
}

/* No WPA support */
airo_print_info("", "WPA unsupported (only firmware versions 5.30.17"
" and greater support WPA. Detected %s)", cap_rid.prodVer);
return 0;
}

static struct net_device *_init_airo_card( unsigned short irq, int port,
int is_pcmcia, struct pci_dev *pci,
struct device *dmdev )
{
struct net_device *dev;
struct airo_info *ai;
int i, rc;
CapabilityRid cap_rid;

/* Create the network device object. */
dev = alloc_netdev(sizeof(*ai), "", ether_setup);
Expand Down Expand Up @@ -2832,7 +2811,7 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
}

if (probe) {
if ( setup_card( ai, dev->dev_addr, 1 ) != SUCCESS ) {
if (setup_card(ai, dev->dev_addr, 1) != SUCCESS) {
airo_print_err(dev->name, "MAC could not be enabled" );
rc = -EIO;
goto err_out_map;
Expand All @@ -2842,28 +2821,47 @@ static struct net_device *_init_airo_card( unsigned short irq, int port,
set_bit(FLAG_FLASHING, &ai->flags);
}

strcpy(dev->name, "eth%d");
rc = register_netdev(dev);
if (rc) {
airo_print_err(dev->name, "Couldn't register_netdev");
goto err_out_map;
}
ai->wifidev = init_wifidev(ai, dev);
if (!ai->wifidev)
goto err_out_reg;

rc = readCapabilityRid(ai, &cap_rid, 1);
if (rc != SUCCESS) {
rc = -EIO;
goto err_out_wifi;
}

airo_print_info(dev->name, "Firmware version %x.%x.%02x",
((le16_to_cpu(cap_rid.softVer) >> 8) & 0xF),
(le16_to_cpu(cap_rid.softVer) & 0xFF),
le16_to_cpu(cap_rid.softSubVer));

/* Test for WPA support */
if (airo_test_wpa_capable(ai)) {
/* Only firmware versions 5.30.17 or better can do WPA */
if (le16_to_cpu(cap_rid.softVer) > 0x530
|| (le16_to_cpu(cap_rid.softVer) == 0x530
&& le16_to_cpu(cap_rid.softSubVer) >= 17)) {
airo_print_info(ai->dev->name, "WPA supported.");

set_bit(FLAG_WPA_CAPABLE, &ai->flags);
ai->bssListFirst = RID_WPA_BSSLISTFIRST;
ai->bssListNext = RID_WPA_BSSLISTNEXT;
ai->bssListRidLen = sizeof(BSSListRid);
} else {
airo_print_info(ai->dev->name, "WPA unsupported with firmware "
"versions older than 5.30.17.");

ai->bssListFirst = RID_BSSLISTFIRST;
ai->bssListNext = RID_BSSLISTNEXT;
ai->bssListRidLen = sizeof(BSSListRid) - sizeof(BSSListRidExtra);
}

strcpy(dev->name, "eth%d");
rc = register_netdev(dev);
if (rc) {
airo_print_err(dev->name, "Couldn't register_netdev");
goto err_out_map;
}
ai->wifidev = init_wifidev(ai, dev);
if (!ai->wifidev)
goto err_out_reg;

set_bit(FLAG_REGISTERED,&ai->flags);
airo_print_info(dev->name, "MAC enabled %pM", dev->dev_addr);

Expand Down

0 comments on commit e6ab327

Please sign in to comment.