Skip to content

Commit

Permalink
Merge branch 'upstream' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/linville/wireless-2.6 into upstream
  • Loading branch information
Jeff Garzik committed Jun 8, 2006
2 parents 862fc81 + 5c601d0 commit ba9b28d
Show file tree
Hide file tree
Showing 15 changed files with 180 additions and 176 deletions.
17 changes: 17 additions & 0 deletions drivers/net/wireless/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,23 @@ config PRISM54
say M here and read <file:Documentation/modules.txt>. The module
will be called prism54.ko.

config USB_ZD1201
tristate "USB ZD1201 based Wireless device support"
depends on USB && NET_RADIO
select FW_LOADER
---help---
Say Y if you want to use wireless LAN adapters based on the ZyDAS
ZD1201 chip.

This driver makes the adapter appear as a normal Ethernet interface,
typically on wlan0.

The zd1201 device requires external firmware to be loaded.
This can be found at http://linux-lc100020.sourceforge.net/

To compile this driver as a module, choose M here: the
module will be called zd1201.

source "drivers/net/wireless/hostap/Kconfig"
source "drivers/net/wireless/bcm43xx/Kconfig"

Expand Down
2 changes: 2 additions & 0 deletions drivers/net/wireless/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,5 @@ obj-$(CONFIG_BCM43XX) += bcm43xx/
# 16-bit wireless PCMCIA client drivers
obj-$(CONFIG_PCMCIA_RAYCS) += ray_cs.o
obj-$(CONFIG_PCMCIA_WL3501) += wl3501_cs.o

obj-$(CONFIG_USB_ZD1201) += zd1201.o
13 changes: 7 additions & 6 deletions drivers/net/wireless/bcm43xx/bcm43xx_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3555,7 +3555,7 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,
unsigned long flags;
int keyidx;

dprintk(KERN_INFO PFX "set security called\n");
dprintk(KERN_INFO PFX "set security called");

bcm43xx_lock_mmio(bcm, flags);

Expand All @@ -3568,24 +3568,25 @@ static void bcm43xx_ieee80211_set_security(struct net_device *net_dev,

if (sec->flags & SEC_ACTIVE_KEY) {
secinfo->active_key = sec->active_key;
dprintk(KERN_INFO PFX " .active_key = %d\n", sec->active_key);
dprintk(", .active_key = %d", sec->active_key);
}
if (sec->flags & SEC_UNICAST_GROUP) {
secinfo->unicast_uses_group = sec->unicast_uses_group;
dprintk(KERN_INFO PFX " .unicast_uses_group = %d\n", sec->unicast_uses_group);
dprintk(", .unicast_uses_group = %d", sec->unicast_uses_group);
}
if (sec->flags & SEC_LEVEL) {
secinfo->level = sec->level;
dprintk(KERN_INFO PFX " .level = %d\n", sec->level);
dprintk(", .level = %d", sec->level);
}
if (sec->flags & SEC_ENABLED) {
secinfo->enabled = sec->enabled;
dprintk(KERN_INFO PFX " .enabled = %d\n", sec->enabled);
dprintk(", .enabled = %d", sec->enabled);
}
if (sec->flags & SEC_ENCRYPT) {
secinfo->encrypt = sec->encrypt;
dprintk(KERN_INFO PFX " .encrypt = %d\n", sec->encrypt);
dprintk(", .encrypt = %d", sec->encrypt);
}
dprintk("\n");
if (bcm->initialized && !bcm->ieee->host_encrypt) {
if (secinfo->enabled) {
/* upload WEP keys to hardware */
Expand Down
67 changes: 26 additions & 41 deletions drivers/usb/net/zd1201.c → drivers/net/wireless/zd1201.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static struct usb_device_id zd1201_table[] = {
{}
};

static int ap = 0; /* Are we an AP or a normal station? */
static int ap; /* Are we an AP or a normal station? */

#define ZD1201_VERSION "0.15"

Expand All @@ -49,7 +49,7 @@ MODULE_DEVICE_TABLE(usb, zd1201_table);
static int zd1201_fw_upload(struct usb_device *dev, int apfw)
{
const struct firmware *fw_entry;
char* data;
char *data;
unsigned long len;
int err;
unsigned char ret;
Expand All @@ -65,7 +65,7 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw)
if (err) {
dev_err(&dev->dev, "Failed to load %s firmware file!\n", fwfile);
dev_err(&dev->dev, "Make sure the hotplug firmware loader is installed.\n");
dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info\n");
dev_err(&dev->dev, "Goto http://linux-lc100020.sourceforge.net for more info.\n");
return err;
}

Expand Down Expand Up @@ -94,12 +94,12 @@ static int zd1201_fw_upload(struct usb_device *dev, int apfw)
USB_DIR_OUT | 0x40, 0, 0, NULL, 0, ZD1201_FW_TIMEOUT);
if (err < 0)
goto exit;

err = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), 0x4,
USB_DIR_IN | 0x40, 0,0, &ret, sizeof(ret), ZD1201_FW_TIMEOUT);
if (err < 0)
goto exit;

if (ret & 0x80) {
err = -EIO;
goto exit;
Expand Down Expand Up @@ -166,13 +166,13 @@ static int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0,
return -ENOMEM;
}
usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out2),
command, 16, zd1201_usbfree, zd);
command, 16, zd1201_usbfree, zd);
ret = usb_submit_urb(urb, GFP_ATOMIC);
if (ret) {
kfree(command);
usb_free_urb(urb);
}

return ret;
}

Expand Down Expand Up @@ -316,7 +316,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
fc = le16_to_cpu(*(__le16 *)&data[datalen-16]);
seq = le16_to_cpu(*(__le16 *)&data[datalen-24]);

if(zd->monitor) {
if (zd->monitor) {
if (datalen < 24)
goto resubmit;
if (!(skb = dev_alloc_skb(datalen+24)))
Expand Down Expand Up @@ -364,7 +364,7 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
goto resubmit;
}
hlist_for_each_entry(frag, node, &zd->fraglist, fnode)
if(frag->seq == (seq&IEEE80211_SCTL_SEQ))
if (frag->seq == (seq&IEEE80211_SCTL_SEQ))
break;
if (!frag)
goto resubmit;
Expand All @@ -376,7 +376,6 @@ static void zd1201_usbrx(struct urb *urb, struct pt_regs *regs)
goto resubmit;
hlist_del_init(&frag->fnode);
kfree(frag);
/* Fallthrough */
} else {
if (datalen<14)
goto resubmit;
Expand Down Expand Up @@ -422,7 +421,7 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata,
int rid_fid;
int length;
unsigned char *pdata;

zd->rxdatas = 0;
err = zd1201_docmd(zd, ZD1201_CMDCODE_ACCESS, rid, 0, 0);
if (err)
Expand Down Expand Up @@ -471,11 +470,11 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata,
length = zd->rxlen;

do {
int actual_length;
int actual_length;

actual_length = (length > 64) ? 64 : length;

if(pdata[0] != 0x3) {
if (pdata[0] != 0x3) {
dev_dbg(&zd->usb->dev, "Rx Resource packet type error: %02X\n",
pdata[0]);
return -EINVAL;
Expand All @@ -487,11 +486,10 @@ static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata,
}

/* Skip the 4 bytes header (RID length and RID) */
if(i == 0) {
if (i == 0) {
pdata += 8;
actual_length -= 8;
}
else {
} else {
pdata += 4;
actual_length -= 4;
}
Expand Down Expand Up @@ -620,7 +618,7 @@ static int zd1201_drvr_start(struct zd1201 *zd)
short max;
__le16 zdmax;
unsigned char *buffer;

buffer = kzalloc(ZD1201_RXSIZE, GFP_KERNEL);
if (!buffer)
return -ENOMEM;
Expand All @@ -632,7 +630,7 @@ static int zd1201_drvr_start(struct zd1201 *zd)
err = usb_submit_urb(zd->rx_urb, GFP_KERNEL);
if (err)
goto err_buffer;

err = zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0);
if (err)
goto err_urb;
Expand Down Expand Up @@ -684,7 +682,7 @@ static int zd1201_enable(struct zd1201 *zd)
static int zd1201_disable(struct zd1201 *zd)
{
int err;

if (!zd->mac_enabled)
return 0;
if (zd->monitor) {
Expand Down Expand Up @@ -764,7 +762,6 @@ static int zd1201_net_open(struct net_device *dev)
static int zd1201_net_stop(struct net_device *dev)
{
netif_stop_queue(dev);

return 0;
}

Expand Down Expand Up @@ -915,7 +912,6 @@ static int zd1201_get_name(struct net_device *dev,
struct iw_request_info *info, char *name, char *extra)
{
strcpy(name, "IEEE 802.11b");

return 0;
}

Expand Down Expand Up @@ -1013,11 +1009,10 @@ static int zd1201_set_mode(struct net_device *dev,
if (err)
return err;
}
zd->monitor=monitor;
zd->monitor = monitor;
/* If monitor mode is set we don't actually turn it on here since it
* is done during mac reset anyway (see zd1201_mac_enable).
*/

zd1201_mac_reset(zd);

return 0;
Expand Down Expand Up @@ -1117,7 +1112,7 @@ static int zd1201_get_wap(struct net_device *dev,
zd->iwstats.qual.updated = 2;
}

return zd1201_getconfig(zd,ZD1201_RID_CURRENTBSSID,ap_addr->sa_data,6);
return zd1201_getconfig(zd, ZD1201_RID_CURRENTBSSID, ap_addr->sa_data, 6);
}

static int zd1201_set_scan(struct net_device *dev,
Expand Down Expand Up @@ -1275,7 +1270,7 @@ static int zd1201_set_rate(struct net_device *dev,
if (!rrq->fixed) { /* Also enable all lower bitrates */
rate |= rate-1;
}

err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL, rate);
if (err)
return err;
Expand Down Expand Up @@ -1486,7 +1481,7 @@ static int zd1201_get_encode(struct net_device *dev,
return -EINVAL;

erq->flags |= i+1;

erq->length = zd->encode_keylen[i];
memcpy(key, zd->encode_keys[i], erq->length);

Expand Down Expand Up @@ -1529,11 +1524,7 @@ static int zd1201_set_power(struct net_device *dev,
return -EINVAL;
}
out:
err = zd1201_setconfig16(zd, ZD1201_RID_CNFPMENABLED, enabled);
if (err)
return err;

return 0;
return zd1201_setconfig16(zd, ZD1201_RID_CNFPMENABLED, enabled);
}

static int zd1201_get_power(struct net_device *dev,
Expand Down Expand Up @@ -1627,15 +1618,11 @@ static int zd1201_set_hostauth(struct net_device *dev,
struct iw_request_info *info, struct iw_param *rrq, char *extra)
{
struct zd1201 *zd = (struct zd1201 *)dev->priv;
int err;

if (!zd->ap)
return -EOPNOTSUPP;

err = zd1201_setconfig16(zd, ZD1201_RID_CNFHOSTAUTH, rrq->value);
if (err)
return err;
return 0;
return zd1201_setconfig16(zd, ZD1201_RID_CNFHOSTAUTH, rrq->value);
}

static int zd1201_get_hostauth(struct net_device *dev,
Expand Down Expand Up @@ -1744,7 +1731,7 @@ static int zd1201_probe(struct usb_interface *interface,
{
struct zd1201 *zd;
struct usb_device *usb;
int i, err;
int err;
short porttype;
char buf[IW_ESSID_MAX_SIZE+2];

Expand Down Expand Up @@ -1773,9 +1760,7 @@ static int zd1201_probe(struct usb_interface *interface,
if (!zd->rx_urb || !zd->tx_urb)
goto err_zd;

for(i = 0; i<100; i++)
udelay(1000);

mdelay(100);
err = zd1201_drvr_start(zd);
if (err)
goto err_zd;
Expand Down Expand Up @@ -1833,7 +1818,7 @@ static int zd1201_probe(struct usb_interface *interface,
goto err_net;
dev_info(&usb->dev, "%s: ZD1201 USB Wireless interface\n",
zd->dev->name);

usb_set_intfdata(interface, zd);
return 0;

Expand Down
File renamed without changes.
17 changes: 0 additions & 17 deletions drivers/usb/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -301,21 +301,4 @@ config USB_NET_ZAURUS
some cases CDC MDLM) protocol, not "g_ether".


config USB_ZD1201
tristate "USB ZD1201 based Wireless device support"
depends on NET_RADIO
select FW_LOADER
---help---
Say Y if you want to use wireless LAN adapters based on the ZyDAS
ZD1201 chip.

This driver makes the adapter appear as a normal Ethernet interface,
typically on wlan0.

The zd1201 device requires external firmware to be loaded.
This can be found at http://linux-lc100020.sourceforge.net/

To compile this driver as a module, choose M here: the
module will be called zd1201.

endmenu
1 change: 0 additions & 1 deletion drivers/usb/net/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ obj-$(CONFIG_USB_NET_RNDIS_HOST) += rndis_host.o
obj-$(CONFIG_USB_NET_CDC_SUBSET) += cdc_subset.o
obj-$(CONFIG_USB_NET_ZAURUS) += zaurus.o
obj-$(CONFIG_USB_USBNET) += usbnet.o
obj-$(CONFIG_USB_ZD1201) += zd1201.o

ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
Expand Down
3 changes: 2 additions & 1 deletion include/net/ieee80211.h
Original file line number Diff line number Diff line change
Expand Up @@ -1247,7 +1247,8 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
extern void ieee80211_txb_free(struct ieee80211_txb *);
extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
struct ieee80211_hdr *frame, int len);
struct ieee80211_hdr *frame, int hdr_len,
int total_len, int encrypt_mpdu);

/* ieee80211_rx.c */
extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb,
Expand Down
2 changes: 1 addition & 1 deletion include/net/ieee80211softmac.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ extern void ieee80211softmac_stop(struct net_device *dev);
* - context set to the context data you want passed
* The return value is 0, or an error.
*/
typedef void (*notify_function_ptr)(struct net_device *dev, void *context);
typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context);

#define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL);
#define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC);
Expand Down
Loading

0 comments on commit ba9b28d

Please sign in to comment.