提交 da3e8908 编写于 作者: G Greg Kroah-Hartman

Staging: otus: fix netdev->priv usage

Now that netdev->priv is gone, fix things up properly in the otus driver
to use ml_priv as it should have always been doing.

Cc: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4bd43f50
......@@ -166,7 +166,7 @@ int usbdrv_chan2freq(int chan)
int usbdrv_ioctl_setessid(struct net_device *dev, struct iw_point *erq)
{
#ifdef ZM_HOSTAPD_SUPPORT
//struct usbdrv_private *macp = dev->priv;
//struct usbdrv_private *macp = dev->ml_priv;
char essidbuf[IW_ESSID_MAX_SIZE+1];
int i;
......@@ -224,7 +224,7 @@ int usbdrv_ioctl_setessid(struct net_device *dev, struct iw_point *erq)
int usbdrv_ioctl_getessid(struct net_device *dev, struct iw_point *erq)
{
//struct usbdrv_private *macp = dev->priv;
//struct usbdrv_private *macp = dev->ml_priv;
u8_t essidbuf[IW_ESSID_MAX_SIZE+1];
u8_t len;
u8_t i;
......@@ -587,7 +587,7 @@ int usbdrvwext_giwname(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrq, char *extra)
{
//struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
//struct usbdrv_private *macp = dev->ml_priv;
strcpy(wrq->name, "IEEE 802.11-MIMO");
......@@ -599,7 +599,7 @@ int usbdrvwext_siwfreq(struct net_device *dev,
struct iw_freq *freq, char *extra)
{
u32_t FreqKHz;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -664,7 +664,7 @@ int usbdrvwext_giwfreq(struct net_device *dev,
struct iw_request_info *info,
struct iw_freq *freq, char *extra)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (macp->DeviceOpened != 1)
return 0;
......@@ -679,7 +679,7 @@ int usbdrvwext_siwmode(struct net_device *dev,
struct iw_request_info *info,
union iwreq_data *wrq, char *extra)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t WlanMode;
if(!netif_running(dev))
......@@ -716,7 +716,7 @@ int usbdrvwext_giwmode(struct net_device *dev,
__u32 *mode, char *extra)
{
unsigned long irqFlag;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -724,7 +724,7 @@ int usbdrvwext_giwmode(struct net_device *dev,
if (macp->DeviceOpened != 1)
return 0;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
switch(zfiWlanQueryWlanMode(dev))
{
......@@ -742,7 +742,7 @@ int usbdrvwext_giwmode(struct net_device *dev,
break;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
......@@ -872,7 +872,7 @@ int usbdrvwext_giwrange(struct net_device *dev,
int usbdrvwext_siwap(struct net_device *dev, struct iw_request_info *info,
struct sockaddr *MacAddr, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -899,7 +899,7 @@ int usbdrvwext_giwap(struct net_device *dev,
struct iw_request_info *info,
struct sockaddr *MacAddr, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (macp->DeviceOpened != 1)
return 0;
......@@ -934,7 +934,7 @@ int usbdrvwext_iwaplist(struct net_device *dev,
int usbdrvwext_siwscan(struct net_device *dev, struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (macp->DeviceOpened != 1)
return 0;
......@@ -950,7 +950,7 @@ int usbdrvwext_giwscan(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *extra)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
//struct zsWlanDev* wd = (struct zsWlanDev*) zmw_wlan_dev(dev);
char *current_ev = extra;
char *end_buf;
......@@ -1015,7 +1015,7 @@ int usbdrvwext_siwessid(struct net_device *dev,
struct iw_point *essid, char *extra)
{
char EssidBuf[IW_ESSID_MAX_SIZE+1];
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -1053,7 +1053,7 @@ int usbdrvwext_giwessid(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *essid, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t EssidLen;
char EssidBuf[IW_ESSID_MAX_SIZE+1];
int ssid_len;
......@@ -1104,7 +1104,7 @@ int usbdrvwext_giwnickn(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *data, char *nickname)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t EssidLen;
char EssidBuf[IW_ESSID_MAX_SIZE+1];
......@@ -1126,7 +1126,7 @@ int usbdrvwext_siwrate(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frq, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
//Array to Define Rate Number that Send to Driver
u16_t zcIndextoRateBG[16] = {1000, 2000, 5500, 11000, 0, 0, 0, 0, 48000,
24000, 12000, 6000, 54000, 36000, 18000, 9000};
......@@ -1171,7 +1171,7 @@ int usbdrvwext_giwrate(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frq, char *extra)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -1190,7 +1190,7 @@ int usbdrvwext_siwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
int val = rts->value;
if (macp->DeviceOpened != 1)
......@@ -1211,7 +1211,7 @@ int usbdrvwext_giwrts(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *rts, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -1231,7 +1231,7 @@ int usbdrvwext_siwfrag(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t fragThreshold;
if (macp->DeviceOpened != 1)
......@@ -1251,7 +1251,7 @@ int usbdrvwext_giwfrag(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frag, char *extra)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16 val;
unsigned long irqFlag;
......@@ -1261,7 +1261,7 @@ int usbdrvwext_giwfrag(struct net_device *dev,
if (macp->DeviceOpened != 1)
return 0;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
val = zfiWlanQueryFragThreshold(dev);
......@@ -1270,7 +1270,7 @@ int usbdrvwext_giwfrag(struct net_device *dev,
frag->disabled = (val >= 2346);
frag->fixed = 1;
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
......@@ -1313,7 +1313,7 @@ int usbdrvwext_siwencode(struct net_device *dev,
{
struct zsKeyInfo keyInfo;
int i, WepState = ZM_ENCRYPTION_WEP_DISABLED;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if(!netif_running(dev))
return -EINVAL;
......@@ -1358,7 +1358,7 @@ int usbdrvwext_giwencode(struct net_device *dev,
struct iw_request_info *info,
struct iw_point *erq, char *key)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t EncryptionMode;
u8_t keyLen = 0;
......@@ -1421,7 +1421,7 @@ int usbdrvwext_siwpower(struct net_device *dev,
struct iw_request_info *info,
struct iw_param *frq, char *extra)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t PSMode;
if (macp->DeviceOpened != 1)
......@@ -1442,19 +1442,19 @@ int usbdrvwext_giwpower(struct net_device *dev,
struct iw_param *frq, char *extra)
{
unsigned long irqFlag;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (macp->DeviceOpened != 1)
return 0;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
if (zfiWlanQueryPowerSaveMode(dev) == ZM_STA_PS_NONE)
frq->disabled = 1;
else
frq->disabled = 0;
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
......@@ -1462,7 +1462,7 @@ int usbdrvwext_giwpower(struct net_device *dev,
//int usbdrvwext_setparam(struct net_device *dev, struct iw_request_info *info,
// void *w, char *extra)
//{
// struct ieee80211vap *vap = dev->priv;
// struct ieee80211vap *vap = dev->ml_priv;
// struct ieee80211com *ic = vap->iv_ic;
// struct ieee80211_rsnparms *rsn = &vap->iv_bss->ni_rsn;
// int *i = (int *) extra;
......@@ -1969,7 +1969,7 @@ int usbdrvwext_setmode(struct net_device *dev, struct iw_request_info *info,
int usbdrvwext_getmode(struct net_device *dev, struct iw_request_info *info,
void *w, char *extra)
{
//struct usbdrv_private *macp = dev->priv;
//struct usbdrv_private *macp = dev->ml_priv;
struct iw_point *wri = (struct iw_point *)extra;
char mode[8];
......@@ -2147,7 +2147,7 @@ int usbdrv_wpa_ioctl(struct net_device *dev, struct athr_wlan_param *zdparm)
u8_t bc_addr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
u8_t mac_addr[80];
struct zsKeyInfo keyInfo;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t vapId = 0;
//zmw_get_wlan_dev(dev);
......@@ -2410,7 +2410,7 @@ int usbdrv_wpa_ioctl(struct net_device *dev, struct athr_wlan_param *zdparm)
#ifdef ZM_ENABLE_CENC
int usbdrv_cenc_ioctl(struct net_device *dev, struct zydas_cenc_param *zdparm)
{
//struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
//struct usbdrv_private *macp = dev->ml_priv;
struct zsKeyInfo keyInfo;
u16_t apId;
u8_t bc_addr[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
......@@ -2508,12 +2508,11 @@ int usbdrv_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
struct zdap_ioctl zdreq;
struct iwreq *wrq = (struct iwreq *)ifr;
struct athr_wlan_param zdparm;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
int err = 0;
int changed = 0;
// macp = dev->priv;
// regp = macp->regp;
if(!netif_running(dev))
......
......@@ -326,7 +326,7 @@ void usbdrv_intr(int irq, void *dev_inst, struct pt_regs *regs)
struct usbdrv_private *macp;
dev = dev_inst;
macp = dev->priv;
macp = dev->ml_priv;
/* Read register error, card may be unpluged */
......@@ -367,7 +367,7 @@ void usbdrv_intr(int irq, void *dev_inst, struct pt_regs *regs)
int usbdrv_open(struct net_device *dev)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
int rc = 0;
u16_t size;
void* mem;
......@@ -516,7 +516,7 @@ int usbdrv_open(struct net_device *dev)
struct net_device_stats * usbdrv_get_stats(struct net_device *dev)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
macp->drv_stats.net_stats.tx_errors =
macp->drv_stats.net_stats.tx_carrier_errors +
......@@ -548,7 +548,7 @@ int usbdrv_set_mac(struct net_device *dev, void *addr)
struct usbdrv_private *macp;
int rc = -1;
macp = dev->priv;
macp = dev->ml_priv;
read_lock(&(macp->isolate_lock));
if (macp->driver_isolated) {
......@@ -599,7 +599,7 @@ int usbdrv_close(struct net_device *dev)
{
extern void zfHpLedCtrl(struct net_device *dev, u16_t ledId, u8_t mode);
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
printk(KERN_DEBUG "usbdrv_close\n");
......@@ -653,7 +653,7 @@ extern void zfHpLedCtrl(struct net_device *dev, u16_t ledId, u8_t mode);
int usbdrv_xmit_frame(struct sk_buff *skb, struct net_device *dev)
{
int notify_stop = FALSE;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
#if 0
/* Test code */
......@@ -715,7 +715,7 @@ void usbdrv_set_multi(struct net_device *dev)
*/
void usbdrv_clear_structs(struct net_device *dev)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
#if (WLAN_HOSTIF == WLAN_PCI)
......@@ -740,7 +740,7 @@ void usbdrv_remove1(struct pci_dev *pcid)
if (!(dev = (struct net_device *) pci_get_drvdata(pcid)))
return;
macp = dev->priv;
macp = dev->ml_priv;
unregister_netdev(dev);
usbdrv_clear_structs(dev);
......@@ -749,7 +749,7 @@ void usbdrv_remove1(struct pci_dev *pcid)
void zfLnx10msTimer(struct net_device* dev)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
mod_timer(&(macp->hbTimer10ms), jiffies + (1*HZ)/100); //10 ms
zfiHeartBeat(dev);
......@@ -814,7 +814,7 @@ int zfLnxVapClose(struct net_device *dev)
int zfLnxVapXmitFrame(struct sk_buff *skb, struct net_device *dev)
{
int notify_stop = FALSE;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t vapId;
vapId = zfLnxGetVapId(dev);
......@@ -871,7 +871,7 @@ int zfLnxRegisterVapDev(struct net_device* parentDev, u16_t vapId)
vap[vapId].dev->base_addr = parentDev->base_addr;
vap[vapId].dev->mem_start = parentDev->mem_start;
vap[vapId].dev->mem_end = parentDev->mem_end;
vap[vapId].dev->priv = parentDev->priv;
vap[vapId].dev->ml_priv = parentDev->ml_priv;
//dev->hard_start_xmit = &zd1212_wds_xmit_frame;
vap[vapId].dev->hard_start_xmit = &zfLnxVapXmitFrame;
......
......@@ -43,7 +43,7 @@ u16_t zfLnxAuthNotify(zdev_t* dev, u16_t* macAddr)
u16_t zfLnxAsocNotify(zdev_t* dev, u16_t* macAddr, u8_t* body, u16_t bodySize, u16_t port)
{
//#ifdef ZM_HOSTAPD_SUPPORT
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
union iwreq_data wreq;
u8_t *addr = (u8_t *) macAddr;
u16_t i, j;
......@@ -141,7 +141,7 @@ void zfLnxConnectNotify(zdev_t* dev, u16_t status, u16_t* bssid)
{
union iwreq_data wreq;
u8_t *addr = (u8_t *) bssid;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (bssid != NULL)
{
......
......@@ -64,19 +64,20 @@ void zfwSleep(zdev_t* dev, u32_t ms)
#ifdef ZM_HALPLUS_LOCK
asmlinkage struct zsWlanDev *zfwGetWlanDev(zdev_t* dev)
{
return ((struct zsWlanDev*)(((struct usbdrv_private*)dev->priv)->wd));
struct usbdrv_private *macp = dev->ml_priv;
return macp->wd;
}
asmlinkage void zfwEnterCriticalSection(zdev_t* dev)
{
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock),
(((struct usbdrv_private *)(dev->priv))->hal_irqFlag));
struct usbdrv_private *macp = dev->ml_priv;
spin_lock_irqsave(&macp->cs_lock, macp->hal_irqFlag);
}
asmlinkage void zfwLeaveCriticalSection(zdev_t* dev)
{
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock),
(((struct usbdrv_private *)(dev->priv))->hal_irqFlag));
struct usbdrv_private *macp = dev->ml_priv;
spin_unlock_irqrestore(&macp->cs_lock, macp->hal_irqFlag);
}
asmlinkage u8_t zfwBufReadByte(zdev_t* dev, zbuf_t* buf, u16_t offset)
......
......@@ -46,7 +46,7 @@ void zfLnxRecv80211(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* addInfo)
u16_t frameCtrl;
u16_t frameSubtype;
zbuf_t *skb1;
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
//frameCtrl = zmw_buf_readb(dev, buf, 0);
frameCtrl = *(u8_t*)((u8_t*)buf->data);
......@@ -88,6 +88,7 @@ void zfLnxRecv80211(zdev_t* dev, zbuf_t* buf, struct zsAdditionInfo* addInfo)
#define ZM_AVOID_UDP_LARGE_PACKET_FAIL
void zfLnxRecvEth(zdev_t* dev, zbuf_t* buf, u16_t port)
{
struct usbdrv_private *macp = dev->ml_priv;
#ifdef ZM_AVOID_UDP_LARGE_PACKET_FAIL
zbuf_t *new_buf;
......@@ -165,10 +166,8 @@ void zfLnxRecvEth(zdev_t* dev, zbuf_t* buf, u16_t port)
case NET_RX_CN_HIGH:
break;
default:
((struct usbdrv_private*)(dev->priv))->
drv_stats.net_stats.rx_packets++;
((struct usbdrv_private*)(dev->priv))->
drv_stats.net_stats.rx_bytes += buf->len;
macp->drv_stats.net_stats.rx_packets++;
macp->drv_stats.net_stats.rx_bytes += buf->len;
break;
}
......
......@@ -112,7 +112,7 @@ void copyToIntTxBuffer(zdev_t* dev, zbuf_t* buf, u8_t* src,
u16_t zfwStaAddIeWpaRsn(zdev_t* dev, zbuf_t* buf, u16_t offset, u8_t frameType)
{
struct usbdrv_private *macp = dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
//zm_msg1_mm(ZM_LV_0, "CWY - add wpaie content Length : ", macp->supIe[1]);
if (macp->supIe[1] != 0)
{
......
......@@ -41,7 +41,7 @@ u32_t zfLnxUsbOut(zdev_t* dev, u8_t *hdr, u16_t hdrlen, u8_t *snap, u16_t snapLe
u32_t zfLnxUsbWriteReg(zdev_t* dev, u32_t* cmd, u16_t cmdLen);
void zfwUsbRegisterCallBack(zdev_t* dev, struct zfCbUsbFuncTbl *zfUsbFunc) {
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
macp->usbCbFunctions.zfcbUsbRecv = zfUsbFunc->zfcbUsbRecv;
macp->usbCbFunctions.zfcbUsbRegIn = zfUsbFunc->zfcbUsbRegIn;
......@@ -52,18 +52,18 @@ void zfwUsbRegisterCallBack(zdev_t* dev, struct zfCbUsbFuncTbl *zfUsbFunc) {
u32_t zfwUsbGetFreeTxQSize(zdev_t* dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u32_t freeTxQSize;
unsigned long irqFlag;
//zmw_declare_for_critical_section();
//zmw_enter_critical_section(dev);
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
freeTxQSize = ZM_MAX_TX_BUF_NUM - macp->TxBufCnt;
//zmw_leave_critical_section(dev);
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return freeTxQSize;
}
......@@ -98,7 +98,7 @@ u32_t zfwUsbSubmitControl(zdev_t* dev, u8_t req, u16_t value, u16_t index, void
{
int result = 0;
u32_t ret = 0;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u8_t* buf;
if (size > 0)
......@@ -134,7 +134,7 @@ u32_t zfwUsbSubmitControl(zdev_t* dev, u8_t req, u16_t value, u16_t index, void
void zfwUsbCmd(zdev_t* dev, u8_t endpt, u32_t* cmd, u16_t cmdLen)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u32_t ret;
//MPUsbCommand(dev, endpt, cmd, cmdLen);
......
......@@ -56,11 +56,11 @@ u32_t zfLnxUsbSubmitIntUrb(urb_t *urb, struct usb_device *usb, u16_t epnum, u16_
u16_t zfLnxGetFreeTxUrb(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t idx;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
//idx = ((macp->TxUrbTail + 1) & (ZM_MAX_TX_URB_NUM - 1));
......@@ -77,17 +77,17 @@ u16_t zfLnxGetFreeTxUrb(zdev_t *dev)
idx = 0xffff;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return idx;
}
void zfLnxPutTxUrb(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t idx;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
idx = ((macp->TxUrbHead + 1) & (ZM_MAX_TX_URB_NUM - 1));
......@@ -103,31 +103,31 @@ void zfLnxPutTxUrb(zdev_t *dev)
macp->TxUrbHead, macp->TxUrbTail);
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
}
u16_t zfLnxCheckTxBufferCnt(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t TxBufCnt;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
TxBufCnt = macp->TxBufCnt;
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return TxBufCnt;
}
UsbTxQ_t *zfLnxGetUsbTxBuffer(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t idx;
UsbTxQ_t *TxQ;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
idx = ((macp->TxBufHead+1) & (ZM_MAX_TX_BUF_NUM - 1));
......@@ -147,11 +147,11 @@ UsbTxQ_t *zfLnxGetUsbTxBuffer(zdev_t *dev)
macp->TxBufHead, macp->TxBufTail);
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return NULL;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return TxQ;
}
......@@ -159,12 +159,12 @@ u16_t zfLnxPutUsbTxBuffer(zdev_t *dev, u8_t *hdr, u16_t hdrlen,
u8_t *snap, u16_t snapLen, u8_t *tail, u16_t tailLen,
zbuf_t *buf, u16_t offset)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t idx;
UsbTxQ_t *TxQ;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
idx = ((macp->TxBufTail+1) & (ZM_MAX_TX_BUF_NUM - 1));
......@@ -192,22 +192,22 @@ u16_t zfLnxPutUsbTxBuffer(zdev_t *dev, u8_t *hdr, u16_t hdrlen,
{
printk(KERN_ERR "zfLnxPutUsbTxBuffer UsbTxBufQ inconsistent: TxBufHead: %d, TxBufTail: %d, TxBufCnt: %d\n",
macp->TxBufHead, macp->TxBufTail, macp->TxBufCnt);
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0xffff;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
zbuf_t *zfLnxGetUsbRxBuffer(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
//u16_t idx;
zbuf_t *buf;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
//idx = ((macp->RxBufHead+1) & (ZM_MAX_RX_URB_NUM - 1));
......@@ -222,21 +222,21 @@ zbuf_t *zfLnxGetUsbRxBuffer(zdev_t *dev)
{
printk("RxBufQ inconsistent: RxBufHead: %d, RxBufTail: %d\n",
macp->RxBufHead, macp->RxBufTail);
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return NULL;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return buf;
}
u32_t zfLnxPutUsbRxBuffer(zdev_t *dev, zbuf_t *buf)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u16_t idx;
unsigned long irqFlag;
spin_lock_irqsave(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_lock_irqsave(&macp->cs_lock, irqFlag);
idx = ((macp->RxBufTail+1) & (ZM_MAX_RX_URB_NUM - 1));
......@@ -251,11 +251,11 @@ u32_t zfLnxPutUsbRxBuffer(zdev_t *dev, zbuf_t *buf)
{
printk("RxBufQ inconsistent: RxBufHead: %d, RxBufTail: %d\n",
macp->RxBufHead, macp->RxBufTail);
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0xffff;
}
spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
......@@ -296,7 +296,7 @@ void zfLnxUsbDataIn_callback(urb_t *urb, struct pt_regs *regs)
#endif
{
zdev_t* dev = urb->context;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
zbuf_t *buf;
zbuf_t *new_buf;
int status;
......@@ -546,7 +546,7 @@ void zfLnxUsbRegIn_callback(urb_t *urb, struct pt_regs *regs)
zdev_t* dev = urb->context;
u32_t rsp[64/4];
int status;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Check status for URB */
if (urb->status != 0){
......@@ -595,7 +595,7 @@ void zfLnxUsbRegIn_callback(urb_t *urb, struct pt_regs *regs)
u32_t zfLnxSubmitRegInUrb(zdev_t *dev)
{
u32_t ret;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Submit a rx urb */
//ret = zfLnxUsbSubmitBulkUrb(macp->RegInUrb, macp->udev,
......@@ -620,7 +620,7 @@ u32_t zfLnxUsbSubmitTxData(zdev_t* dev)
u8_t *puTxBuf = NULL;
UsbTxQ_t *TxData;
int len = 0;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
#if ZM_USB_TX_STREAM_MODE == 1
u8_t ii;
u16_t offset = 0;
......@@ -797,7 +797,7 @@ u32_t zfLnxUsbSubmitTxData(zdev_t* dev)
u32_t zfLnxUsbIn(zdev_t* dev, urb_t *urb, zbuf_t *buf)
{
u32_t ret;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Submit a rx urb */
ret = zfLnxUsbSubmitBulkUrb(urb, macp->udev, USB_WLAN_RX_PIPE,
......@@ -812,7 +812,7 @@ u32_t zfLnxUsbIn(zdev_t* dev, urb_t *urb, zbuf_t *buf)
u32_t zfLnxUsbWriteReg(zdev_t* dev, u32_t* cmd, u16_t cmdLen)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
u32_t ret;
#ifdef ZM_CONFIG_BIG_ENDIAN
......@@ -844,7 +844,7 @@ u32_t zfLnxUsbOut(zdev_t* dev, u8_t *hdr, u16_t hdrlen, u8_t *snap, u16_t snapLe
u8_t *tail, u16_t tailLen, zbuf_t *buf, u16_t offset)
{
u32_t ret;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Check length of tail buffer */
//zm_assert((tailLen <= 16));
......@@ -867,7 +867,7 @@ u32_t zfLnxUsbOut(zdev_t* dev, u8_t *hdr, u16_t hdrlen, u8_t *snap, u16_t snapLe
void zfLnxInitUsbTxQ(zdev_t* dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
printk(KERN_ERR "zfwInitUsbTxQ\n");
......@@ -885,7 +885,7 @@ void zfLnxInitUsbRxQ(zdev_t* dev)
{
u16_t i;
zbuf_t *buf;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Zero memory for UsbRxBufQ */
memset(macp->UsbRxBufQ, 0, sizeof(zbuf_t *) * ZM_MAX_RX_URB_NUM);
......@@ -1086,7 +1086,7 @@ void kevent(void *data)
zdev_t *dev = macp->device;
#else
zdev_t *dev = (zdev_t *) data;
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
#endif
if (macp == NULL)
......@@ -1133,7 +1133,7 @@ void kevent(void *data)
/************************************************************************/
u8_t zfLnxCreateThread(zdev_t *dev)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
/* Create Mutex and keventd */
#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,20))
......@@ -1164,7 +1164,7 @@ u8_t zfLnxCreateThread(zdev_t *dev)
/************************************************************************/
void zfLnxSignalThread(zdev_t *dev, int flag)
{
struct usbdrv_private *macp = (struct usbdrv_private *)dev->priv;
struct usbdrv_private *macp = dev->ml_priv;
if (macp == NULL)
{
......
......@@ -141,7 +141,7 @@ static int zfLnxProbe(struct usb_interface *interface,
SET_MODULE_OWNER(net);
#endif
net->priv = macp; //kernel 2.6
net->ml_priv = macp; //kernel 2.6
macp->udev = dev;
macp->device = net;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册