Lines Matching refs:zd
123 struct zd1201 *zd = urb->context; in zd1201_usbfree() local
133 dev_warn(&zd->usb->dev, "%s: urb failed: %d\n", in zd1201_usbfree()
134 zd->dev->name, urb->status); in zd1201_usbfree()
151 static int zd1201_docmd(struct zd1201 *zd, int cmd, int parm0, in zd1201_docmd() argument
173 usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out2), in zd1201_docmd()
174 command, 16, zd1201_usbfree, zd); in zd1201_docmd()
187 struct zd1201 *zd = urb->context; in zd1201_usbtx() local
188 netif_wake_queue(zd->dev); in zd1201_usbtx()
194 struct zd1201 *zd = urb->context; in zd1201_usbrx() local
200 if (!zd) in zd1201_usbrx()
211 dev_warn(&zd->usb->dev, "%s: rx urb failed: %d\n", in zd1201_usbrx()
212 zd->dev->name, urb->status); in zd1201_usbrx()
222 memcpy(zd->rxdata, data, urb->actual_length); in zd1201_usbrx()
223 zd->rxlen = urb->actual_length; in zd1201_usbrx()
224 zd->rxdatas = 1; in zd1201_usbrx()
225 wake_up(&zd->rxdataq); in zd1201_usbrx()
239 netif_carrier_on(zd->dev); in zd1201_usbrx()
242 netif_carrier_off(zd->dev); in zd1201_usbrx()
245 netif_carrier_off(zd->dev); in zd1201_usbrx()
248 netif_carrier_on(zd->dev); in zd1201_usbrx()
251 netif_carrier_off(zd->dev); in zd1201_usbrx()
275 wireless_send_event(zd->dev, event, &wrqu, NULL); in zd1201_usbrx()
288 wireless_send_event(zd->dev, IWEVEXPIRED, &wrqu, NULL); in zd1201_usbrx()
292 zd->rxlen = 0; in zd1201_usbrx()
296 if (copylen+zd->rxlen > sizeof(zd->rxdata)) in zd1201_usbrx()
298 memcpy(zd->rxdata+zd->rxlen, data+i+4, copylen); in zd1201_usbrx()
299 zd->rxlen += copylen; in zd1201_usbrx()
303 zd->rxdatas = 1; in zd1201_usbrx()
304 wake_up(&zd->rxdataq); in zd1201_usbrx()
319 if (zd->monitor) { in zd1201_usbrx()
332 skb->protocol = eth_type_trans(skb, zd->dev); in zd1201_usbrx()
333 zd->dev->stats.rx_packets++; in zd1201_usbrx()
334 zd->dev->stats.rx_bytes += skb->len; in zd1201_usbrx()
361 hlist_add_head(&frag->fnode, &zd->fraglist); in zd1201_usbrx()
364 hlist_for_each_entry(frag, &zd->fraglist, fnode) in zd1201_usbrx()
388 skb->protocol = eth_type_trans(skb, zd->dev); in zd1201_usbrx()
389 zd->dev->stats.rx_packets++; in zd1201_usbrx()
390 zd->dev->stats.rx_bytes += skb->len; in zd1201_usbrx()
397 urb->dev = zd->usb; in zd1201_usbrx()
403 zd->rxlen = 0; in zd1201_usbrx()
404 zd->rxdatas = 1; in zd1201_usbrx()
405 wake_up(&zd->rxdataq); in zd1201_usbrx()
410 static int zd1201_getconfig(struct zd1201 *zd, int rid, void *riddata, in zd1201_getconfig() argument
420 zd->rxdatas = 0; in zd1201_getconfig()
421 err = zd1201_docmd(zd, ZD1201_CMDCODE_ACCESS, rid, 0, 0); in zd1201_getconfig()
425 wait_event_interruptible(zd->rxdataq, zd->rxdatas); in zd1201_getconfig()
426 if (!zd->rxlen) in zd1201_getconfig()
429 code = le16_to_cpu(*(__le16*)(&zd->rxdata[4])); in zd1201_getconfig()
430 rid_fid = le16_to_cpu(*(__le16*)(&zd->rxdata[6])); in zd1201_getconfig()
431 length = le16_to_cpu(*(__le16*)(&zd->rxdata[8])); in zd1201_getconfig()
432 if (length > zd->rxlen) in zd1201_getconfig()
433 length = zd->rxlen-6; in zd1201_getconfig()
441 …dev_dbg(&zd->usb->dev, "riddatalen mismatches, expected=%u, (packet=%u) length=%u, rid=0x%04X, rid… in zd1201_getconfig()
442 riddatalen, zd->rxlen, length, rid, rid_fid); in zd1201_getconfig()
446 zd->rxdatas = 0; in zd1201_getconfig()
448 err = zd1201_docmd(zd, ZD1201_CMDCODE_SETRXRID, rid, 0, length); in zd1201_getconfig()
453 wait_event_interruptible(zd->rxdataq, zd->rxdatas); in zd1201_getconfig()
454 if (!zd->rxlen) in zd1201_getconfig()
457 if (zd->rxdata[zd->rxlen - 1] != ZD1201_PACKET_RESOURCE) { in zd1201_getconfig()
458 dev_dbg(&zd->usb->dev, "Packet type mismatch: 0x%x not 0x3\n", in zd1201_getconfig()
459 zd->rxdata[zd->rxlen-1]); in zd1201_getconfig()
464 pdata = zd->rxdata; in zd1201_getconfig()
465 length = zd->rxlen; in zd1201_getconfig()
473 dev_dbg(&zd->usb->dev, "Rx Resource packet type error: %02X\n", in zd1201_getconfig()
510 static int zd1201_setconfig(struct zd1201 *zd, int rid, void *buf, int len, int wait) in zd1201_setconfig() argument
521 zd->rxdatas = 0; in zd1201_setconfig()
522 zd->rxlen = 0; in zd1201_setconfig()
551 usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, in zd1201_setconfig()
552 zd->endp_out2), request, 16, zd1201_usbfree, zd); in zd1201_setconfig()
572 usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out2), in zd1201_setconfig()
573 request, 16, zd1201_usbfree, zd); in zd1201_setconfig()
579 wait_event_interruptible(zd->rxdataq, zd->rxdatas); in zd1201_setconfig()
580 if (!zd->rxlen || le16_to_cpu(*(__le16*)&zd->rxdata[6]) != rid) { in zd1201_setconfig()
581 dev_dbg(&zd->usb->dev, "wrong or no RID received\n"); in zd1201_setconfig()
592 static inline int zd1201_getconfig16(struct zd1201 *zd, int rid, short *val) in zd1201_getconfig16() argument
597 err = zd1201_getconfig(zd, rid, &zdval, sizeof(__le16)); in zd1201_getconfig16()
604 static inline int zd1201_setconfig16(struct zd1201 *zd, int rid, short val) in zd1201_setconfig16() argument
607 return (zd1201_setconfig(zd, rid, &zdval, sizeof(__le16), 1)); in zd1201_setconfig16()
610 static int zd1201_drvr_start(struct zd1201 *zd) in zd1201_drvr_start() argument
621 usb_fill_bulk_urb(zd->rx_urb, zd->usb, in zd1201_drvr_start()
622 usb_rcvbulkpipe(zd->usb, zd->endp_in), buffer, ZD1201_RXSIZE, in zd1201_drvr_start()
623 zd1201_usbrx, zd); in zd1201_drvr_start()
625 err = usb_submit_urb(zd->rx_urb, GFP_KERNEL); in zd1201_drvr_start()
629 err = zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0); in zd1201_drvr_start()
633 err = zd1201_getconfig(zd, ZD1201_RID_CNFMAXTXBUFFERNUMBER, &zdmax, in zd1201_drvr_start()
640 err = zd1201_docmd(zd, ZD1201_CMDCODE_ALLOC, 1514, 0, 0); in zd1201_drvr_start()
648 usb_kill_urb(zd->rx_urb); in zd1201_drvr_start()
660 static int zd1201_enable(struct zd1201 *zd) in zd1201_enable() argument
664 if (zd->mac_enabled) in zd1201_enable()
667 err = zd1201_docmd(zd, ZD1201_CMDCODE_ENABLE, 0, 0, 0); in zd1201_enable()
669 zd->mac_enabled = 1; in zd1201_enable()
671 if (zd->monitor) in zd1201_enable()
672 err = zd1201_setconfig16(zd, ZD1201_RID_PROMISCUOUSMODE, 1); in zd1201_enable()
677 static int zd1201_disable(struct zd1201 *zd) in zd1201_disable() argument
681 if (!zd->mac_enabled) in zd1201_disable()
683 if (zd->monitor) { in zd1201_disable()
684 err = zd1201_setconfig16(zd, ZD1201_RID_PROMISCUOUSMODE, 0); in zd1201_disable()
689 err = zd1201_docmd(zd, ZD1201_CMDCODE_DISABLE, 0, 0, 0); in zd1201_disable()
691 zd->mac_enabled = 0; in zd1201_disable()
695 static int zd1201_mac_reset(struct zd1201 *zd) in zd1201_mac_reset() argument
697 if (!zd->mac_enabled) in zd1201_mac_reset()
699 zd1201_disable(zd); in zd1201_mac_reset()
700 return zd1201_enable(zd); in zd1201_mac_reset()
703 static int zd1201_join(struct zd1201 *zd, char *essid, int essidlen) in zd1201_join() argument
708 err = zd1201_disable(zd); in zd1201_join()
714 err = zd1201_setconfig16(zd, ZD1201_RID_CNFAUTHENTICATION, val); in zd1201_join()
720 if (!zd->ap) { /* Normal station */ in zd1201_join()
721 err = zd1201_setconfig(zd, ZD1201_RID_CNFDESIREDSSID, buf, in zd1201_join()
726 err = zd1201_setconfig(zd, ZD1201_RID_CNFOWNSSID, buf, in zd1201_join()
732 err = zd1201_setconfig(zd, ZD1201_RID_CNFOWNMACADDR, in zd1201_join()
733 zd->dev->dev_addr, zd->dev->addr_len, 1); in zd1201_join()
737 err = zd1201_enable(zd); in zd1201_join()
747 struct zd1201 *zd = netdev_priv(dev); in zd1201_net_open() local
750 if (!zd->mac_enabled) in zd1201_net_open()
751 zd1201_join(zd, zd->essid, zd->essidlen); in zd1201_net_open()
786 struct zd1201 *zd = netdev_priv(dev); in zd1201_hard_start_xmit() local
787 unsigned char *txbuf = zd->txdata; in zd1201_hard_start_xmit()
789 struct urb *urb = zd->tx_urb; in zd1201_hard_start_xmit()
791 if (!zd->mac_enabled || zd->monitor) { in zd1201_hard_start_xmit()
817 usb_fill_bulk_urb(urb, zd->usb, usb_sndbulkpipe(zd->usb, zd->endp_out), in zd1201_hard_start_xmit()
818 txbuf, txbuflen, zd1201_usbtx, zd); in zd1201_hard_start_xmit()
820 err = usb_submit_urb(zd->tx_urb, GFP_ATOMIC); in zd1201_hard_start_xmit()
835 struct zd1201 *zd = netdev_priv(dev); in zd1201_tx_timeout() local
837 if (!zd) in zd1201_tx_timeout()
839 dev_warn(&zd->usb->dev, "%s: TX timeout, shooting down urb\n", in zd1201_tx_timeout()
841 usb_unlink_urb(zd->tx_urb); in zd1201_tx_timeout()
850 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_mac_address() local
853 if (!zd) in zd1201_set_mac_address()
856 err = zd1201_setconfig(zd, ZD1201_RID_CNFOWNMACADDR, in zd1201_set_mac_address()
862 return zd1201_mac_reset(zd); in zd1201_set_mac_address()
867 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_wireless_stats() local
869 return &zd->iwstats; in zd1201_get_wireless_stats()
874 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_multicast() local
885 zd1201_setconfig(zd, ZD1201_RID_CNFGROUPADDRESS, reqbuf, in zd1201_set_multicast()
892 struct zd1201 *zd = netdev_priv(dev); in zd1201_config_commit() local
894 return zd1201_mac_reset(zd); in zd1201_config_commit()
907 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_freq() local
916 err = zd1201_setconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, channel); in zd1201_set_freq()
920 zd1201_mac_reset(zd); in zd1201_set_freq()
928 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_freq() local
932 err = zd1201_getconfig16(zd, ZD1201_RID_CNFOWNCHANNEL, &channel); in zd1201_get_freq()
944 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_mode() local
949 if (zd->ap) { in zd1201_set_mode()
955 err = zd1201_setconfig16(zd, ZD1201_RID_PROMISCUOUSMODE, 0); in zd1201_set_mode()
958 zd->dev->type = ARPHRD_ETHER; in zd1201_set_mode()
962 zd->dev->type = ARPHRD_IEEE80211; in zd1201_set_mode()
967 zd1201_join(zd, "\0-*#\0", 5); in zd1201_set_mode()
983 err = zd1201_setconfig16(zd, ZD1201_RID_CNFPORTTYPE, porttype); in zd1201_set_mode()
986 if (zd->monitor && !monitor) { in zd1201_set_mode()
987 zd1201_disable(zd); in zd1201_set_mode()
988 *(__le16 *)buffer = cpu_to_le16(zd->essidlen); in zd1201_set_mode()
989 memcpy(buffer+2, zd->essid, zd->essidlen); in zd1201_set_mode()
990 err = zd1201_setconfig(zd, ZD1201_RID_CNFDESIREDSSID, in zd1201_set_mode()
995 zd->monitor = monitor; in zd1201_set_mode()
999 zd1201_mac_reset(zd); in zd1201_set_mode()
1007 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_mode() local
1011 err = zd1201_getconfig16(zd, ZD1201_RID_CNFPORTTYPE, &porttype); in zd1201_get_mode()
1031 dev_dbg(&zd->usb->dev, "Unknown porttype: %d\n", in zd1201_get_mode()
1035 if (zd->monitor) in zd1201_get_mode()
1083 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_wap() local
1086 if (!zd1201_getconfig(zd, ZD1201_RID_COMMSQUALITY, buffer, 6)) { in zd1201_get_wap()
1093 zd->iwstats.qual.level = le16_to_cpu(((__le16 *)buffer)[1]); in zd1201_get_wap()
1095 zd->iwstats.qual.updated = 2; in zd1201_get_wap()
1098 return zd1201_getconfig(zd, ZD1201_RID_CURRENTBSSID, ap_addr->sa_data, 6); in zd1201_get_wap()
1111 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_scan() local
1118 if (zd->ap) in zd1201_get_scan()
1122 enabled_save = zd->mac_enabled; in zd1201_get_scan()
1123 zd1201_enable(zd); in zd1201_get_scan()
1125 zd->rxdatas = 0; in zd1201_get_scan()
1126 err = zd1201_docmd(zd, ZD1201_CMDCODE_INQUIRE, in zd1201_get_scan()
1131 wait_event_interruptible(zd->rxdataq, zd->rxdatas); in zd1201_get_scan()
1132 if (!zd->rxlen) in zd1201_get_scan()
1135 if (le16_to_cpu(*(__le16*)&zd->rxdata[2]) != ZD1201_INQ_SCANRESULTS) in zd1201_get_scan()
1138 for(i=8; i<zd->rxlen; i+=62) { in zd1201_get_scan()
1141 memcpy(iwe.u.ap_addr.sa_data, zd->rxdata+i+6, 6); in zd1201_get_scan()
1146 iwe.u.data.length = zd->rxdata[i+16]; in zd1201_get_scan()
1149 &iwe, zd->rxdata+i+18); in zd1201_get_scan()
1152 if (zd->rxdata[i+14]&0x01) in zd1201_get_scan()
1160 iwe.u.freq.m = zd->rxdata[i+0]; in zd1201_get_scan()
1168 for (j=0; j<10; j++) if (zd->rxdata[i+50+j]) { in zd1201_get_scan()
1169 iwe.u.bitrate.value = (zd->rxdata[i+50+j]&0x7f)*500000; in zd1201_get_scan()
1176 if (zd->rxdata[i+14]&0x10) in zd1201_get_scan()
1183 iwe.u.qual.qual = zd->rxdata[i+4]; in zd1201_get_scan()
1184 iwe.u.qual.noise= zd->rxdata[i+2]/10-100; in zd1201_get_scan()
1185 iwe.u.qual.level = (256+zd->rxdata[i+4]*100)/255-100; in zd1201_get_scan()
1192 zd1201_disable(zd); in zd1201_get_scan()
1203 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_essid() local
1209 zd->essidlen = data->length; in zd1201_set_essid()
1210 memset(zd->essid, 0, IW_ESSID_MAX_SIZE+1); in zd1201_set_essid()
1211 memcpy(zd->essid, essid, data->length); in zd1201_set_essid()
1212 return zd1201_join(zd, zd->essid, zd->essidlen); in zd1201_set_essid()
1218 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_essid() local
1220 memcpy(essid, zd->essid, zd->essidlen); in zd1201_get_essid()
1222 data->length = zd->essidlen; in zd1201_get_essid()
1239 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_rate() local
1262 err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL, rate); in zd1201_set_rate()
1266 return zd1201_mac_reset(zd); in zd1201_set_rate()
1272 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_rate() local
1276 err = zd1201_getconfig16(zd, ZD1201_RID_CURRENTTXRATE, &rate); in zd1201_get_rate()
1305 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_rts() local
1316 err = zd1201_setconfig16(zd, ZD1201_RID_CNFRTSTHRESHOLD, val); in zd1201_set_rts()
1319 return zd1201_mac_reset(zd); in zd1201_set_rts()
1325 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_rts() local
1329 err = zd1201_getconfig16(zd, ZD1201_RID_CNFRTSTHRESHOLD, &rtst); in zd1201_get_rts()
1342 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_frag() local
1354 err = zd1201_setconfig16(zd, ZD1201_RID_CNFFRAGTHRESHOLD, val); in zd1201_set_frag()
1357 return zd1201_mac_reset(zd); in zd1201_set_frag()
1363 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_frag() local
1367 err = zd1201_getconfig16(zd, ZD1201_RID_CNFFRAGTHRESHOLD, &fragt); in zd1201_get_frag()
1392 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_encode() local
1401 err = zd1201_getconfig16(zd,ZD1201_RID_CNFDEFAULTKEYID,&i); in zd1201_set_encode()
1405 err = zd1201_setconfig16(zd, ZD1201_RID_CNFDEFAULTKEYID, i); in zd1201_set_encode()
1414 err = zd1201_setconfig(zd, rid, key, erq->length, 1); in zd1201_set_encode()
1417 zd->encode_keylen[i] = erq->length; in zd1201_set_encode()
1418 memcpy(zd->encode_keys[i], key, erq->length); in zd1201_set_encode()
1423 zd->encode_enabled = 1; in zd1201_set_encode()
1425 zd->encode_enabled = 0; in zd1201_set_encode()
1428 zd->encode_restricted = 1; in zd1201_set_encode()
1430 zd->encode_restricted = 0; in zd1201_set_encode()
1431 err = zd1201_setconfig16(zd, ZD1201_RID_CNFWEBFLAGS, i); in zd1201_set_encode()
1435 if (zd->encode_enabled) in zd1201_set_encode()
1439 err = zd1201_setconfig16(zd, ZD1201_RID_CNFAUTHENTICATION, i); in zd1201_set_encode()
1443 return zd1201_mac_reset(zd); in zd1201_set_encode()
1449 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_encode() local
1453 if (zd->encode_enabled) in zd1201_get_encode()
1457 if (zd->encode_restricted) in zd1201_get_encode()
1464 err = zd1201_getconfig16(zd, ZD1201_RID_CNFDEFAULTKEYID, &i); in zd1201_get_encode()
1473 erq->length = zd->encode_keylen[i]; in zd1201_get_encode()
1474 memcpy(key, zd->encode_keys[i], erq->length); in zd1201_get_encode()
1482 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_power() local
1490 err = zd1201_setconfig16(zd, in zd1201_set_power()
1497 err = zd1201_getconfig16(zd, in zd1201_set_power()
1506 err = zd1201_setconfig16(zd, ZD1201_RID_CNFPMEPS, in zd1201_set_power()
1515 return zd1201_setconfig16(zd, ZD1201_RID_CNFPMENABLED, enabled); in zd1201_set_power()
1521 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_power() local
1525 err = zd1201_getconfig16(zd, ZD1201_RID_CNFPMENABLED, &enabled); in zd1201_get_power()
1528 err = zd1201_getconfig16(zd, ZD1201_RID_CNFPMEPS, &level); in zd1201_get_power()
1531 err = zd1201_getconfig16(zd, ZD1201_RID_CNFMAXSLEEPDURATION, &duration); in zd1201_get_power()
1608 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_hostauth() local
1610 if (!zd->ap) in zd1201_set_hostauth()
1613 return zd1201_setconfig16(zd, ZD1201_RID_CNFHOSTAUTH, rrq->value); in zd1201_set_hostauth()
1619 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_hostauth() local
1623 if (!zd->ap) in zd1201_get_hostauth()
1626 err = zd1201_getconfig16(zd, ZD1201_RID_CNFHOSTAUTH, &hostauth); in zd1201_get_hostauth()
1638 struct zd1201 *zd = netdev_priv(dev); in zd1201_auth_sta() local
1641 if (!zd->ap) in zd1201_auth_sta()
1648 return zd1201_setconfig(zd, ZD1201_RID_AUTHENTICATESTA, buffer, 10, 1); in zd1201_auth_sta()
1654 struct zd1201 *zd = netdev_priv(dev); in zd1201_set_maxassoc() local
1656 if (!zd->ap) in zd1201_set_maxassoc()
1659 return zd1201_setconfig16(zd, ZD1201_RID_CNFMAXASSOCSTATIONS, rrq->value); in zd1201_set_maxassoc()
1665 struct zd1201 *zd = netdev_priv(dev); in zd1201_get_maxassoc() local
1669 if (!zd->ap) in zd1201_get_maxassoc()
1672 err = zd1201_getconfig16(zd, ZD1201_RID_CNFMAXASSOCSTATIONS, &maxassoc); in zd1201_get_maxassoc()
1726 struct zd1201 *zd; in zd1201_probe() local
1735 dev = alloc_etherdev(sizeof(*zd)); in zd1201_probe()
1738 zd = netdev_priv(dev); in zd1201_probe()
1739 zd->dev = dev; in zd1201_probe()
1741 zd->ap = ap; in zd1201_probe()
1742 zd->usb = usb; in zd1201_probe()
1743 zd->removed = 0; in zd1201_probe()
1744 init_waitqueue_head(&zd->rxdataq); in zd1201_probe()
1745 INIT_HLIST_HEAD(&zd->fraglist); in zd1201_probe()
1747 err = zd1201_fw_upload(usb, zd->ap); in zd1201_probe()
1753 zd->endp_in = 1; in zd1201_probe()
1754 zd->endp_out = 1; in zd1201_probe()
1755 zd->endp_out2 = 2; in zd1201_probe()
1756 zd->rx_urb = usb_alloc_urb(0, GFP_KERNEL); in zd1201_probe()
1757 zd->tx_urb = usb_alloc_urb(0, GFP_KERNEL); in zd1201_probe()
1758 if (!zd->rx_urb || !zd->tx_urb) { in zd1201_probe()
1764 err = zd1201_drvr_start(zd); in zd1201_probe()
1768 err = zd1201_setconfig16(zd, ZD1201_RID_CNFMAXDATALEN, 2312); in zd1201_probe()
1772 err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL, in zd1201_probe()
1782 err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, in zd1201_probe()
1789 err = zd1201_setconfig(zd, ZD1201_RID_CNFDESIREDSSID, buf, in zd1201_probe()
1794 if (zd->ap) in zd1201_probe()
1798 err = zd1201_setconfig16(zd, ZD1201_RID_CNFPORTTYPE, porttype); in zd1201_probe()
1810 usb_set_intfdata(interface, zd); in zd1201_probe()
1811 zd1201_enable(zd); /* zd1201 likes to startup enabled, */ in zd1201_probe()
1812 zd1201_disable(zd); /* interfering with all the wifis in range */ in zd1201_probe()
1817 zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0); in zd1201_probe()
1819 usb_free_urb(zd->tx_urb); in zd1201_probe()
1820 usb_free_urb(zd->rx_urb); in zd1201_probe()
1827 struct zd1201 *zd = usb_get_intfdata(interface); in zd1201_disconnect() local
1831 if (!zd) in zd1201_disconnect()
1835 hlist_for_each_entry_safe(frag, node2, &zd->fraglist, fnode) { in zd1201_disconnect()
1841 if (zd->tx_urb) { in zd1201_disconnect()
1842 usb_kill_urb(zd->tx_urb); in zd1201_disconnect()
1843 usb_free_urb(zd->tx_urb); in zd1201_disconnect()
1845 if (zd->rx_urb) { in zd1201_disconnect()
1846 usb_kill_urb(zd->rx_urb); in zd1201_disconnect()
1847 usb_free_urb(zd->rx_urb); in zd1201_disconnect()
1850 if (zd->dev) { in zd1201_disconnect()
1851 unregister_netdev(zd->dev); in zd1201_disconnect()
1852 free_netdev(zd->dev); in zd1201_disconnect()
1861 struct zd1201 *zd = usb_get_intfdata(interface); in zd1201_suspend() local
1863 netif_device_detach(zd->dev); in zd1201_suspend()
1865 zd->was_enabled = zd->mac_enabled; in zd1201_suspend()
1867 if (zd->was_enabled) in zd1201_suspend()
1868 return zd1201_disable(zd); in zd1201_suspend()
1875 struct zd1201 *zd = usb_get_intfdata(interface); in zd1201_resume() local
1877 if (!zd || !zd->dev) in zd1201_resume()
1880 netif_device_attach(zd->dev); in zd1201_resume()
1882 if (zd->was_enabled) in zd1201_resume()
1883 return zd1201_enable(zd); in zd1201_resume()