int zd1201_probe(struct usb_interface *interface, const struct usb_device_id *id) 
static int zd1201_probe(struct usb_interface *interface, const struct usb_device_id *id) 
int zd1201_probe(struct usb_interface *interface, const struct usb_device_id *id){	struct zd1201 *zd;	struct usb_device *usb;	int i, err;	short porttype;	char buf[IW_ESSID_MAX_SIZE+2];	usb = interface_to_usbdev(interface);	zd = kmalloc(sizeof(struct zd1201), GFP_KERNEL);	if (!zd) {		return -ENOMEM;	}	memset(zd, 0, sizeof(struct zd1201));	zd->ap = ap;	zd->usb = usb;	zd->removed = 0;	init_waitqueue_head(&zd->rxdataq);	INIT_HLIST_HEAD(&zd->fraglist);		err = zd1201_fw_upload(usb, zd->ap);	if (err) {		dev_err(&usb->dev, "zd1201 firmware upload failed: %d\n", err);		goto err_zd;	}		zd->endp_in = 1;	zd->endp_out = 1;	zd->endp_out2 = 2;	zd->rx_urb = usb_alloc_urb(0, GFP_KERNEL);	zd->tx_urb = usb_alloc_urb(0, GFP_KERNEL);	if (!zd->rx_urb || !zd->tx_urb)		goto err_zd;	for(i = 0; i<100; i++)		udelay(1000);	err = zd1201_drvr_start(zd);	if (err)		goto err_zd;	err = zd1201_setconfig16(zd, ZD1201_RID_CNFMAXDATALEN, 2312);	if (err)		goto err_start;	err = zd1201_setconfig16(zd, ZD1201_RID_TXRATECNTL,	    ZD1201_RATEB1 | ZD1201_RATEB2 | ZD1201_RATEB5 | ZD1201_RATEB11);	if (err)		goto err_start;	zd->dev = alloc_etherdev(0);	if (!zd->dev)		goto err_start;	zd->dev->priv = zd;	zd->dev->open = zd1201_net_open;	zd->dev->stop = zd1201_net_stop;	zd->dev->get_stats = zd1201_get_stats;	zd->dev->get_wireless_stats = zd1201_get_wireless_stats;	zd->dev->wireless_handlers =	    (struct iw_handler_def *)&zd1201_iw_handlers;	zd->dev->hard_start_xmit = zd1201_hard_start_xmit;	zd->dev->watchdog_timeo = ZD1201_TX_TIMEOUT;	zd->dev->tx_timeout = zd1201_tx_timeout;	zd->dev->set_multicast_list = zd1201_set_multicast;	zd->dev->set_mac_address = zd1201_set_mac_address;	strcpy(zd->dev->name, "wlan%d");	err = zd1201_getconfig(zd, ZD1201_RID_CNFOWNMACADDR, 	    zd->dev->dev_addr, zd->dev->addr_len);	if (err)		goto err_net;	/* Set wildcard essid to match zd->essid */	*(__le16 *)buf = cpu_to_le16(0);	err = zd1201_setconfig(zd, ZD1201_RID_CNFDESIREDSSID, buf,	    IW_ESSID_MAX_SIZE+2, 1);	if (err)		goto err_net;	if (zd->ap)		porttype = ZD1201_PORTTYPE_AP;	else		porttype = ZD1201_PORTTYPE_BSS;	err = zd1201_setconfig16(zd, ZD1201_RID_CNFPORTTYPE, porttype);	if (err)		goto err_net;	err = register_netdev(zd->dev);	if (err)		goto err_net;	dev_info(&usb->dev, "%s: ZD1201 USB Wireless interface\n",	    zd->dev->name);		usb_set_intfdata(interface, zd);	return 0;err_net:	free_netdev(zd->dev);err_start:	/* Leave the device in reset state */	zd1201_docmd(zd, ZD1201_CMDCODE_INIT, 0, 0, 0);err_zd:	if (zd->tx_urb)		usb_free_urb(zd->tx_urb);	if (zd->rx_urb)		usb_free_urb(zd->rx_urb);	kfree(zd);	return err;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/2e0a6b8cd27375089f8356e7f1ce2319059696eb/zd1201.c/clean/drivers/usb/net/zd1201.c