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;
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;
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");
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;
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;
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))
__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;
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))
{
break;
}
- spin_unlock_irqrestore(&(((struct usbdrv_private *)(dev->priv))->cs_lock), irqFlag);
+ spin_unlock_irqrestore(&macp->cs_lock, irqFlag);
return 0;
}
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;
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;
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;
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;
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;
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;
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];
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};
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;
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)
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;
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)
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;
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);
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;
}
{
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;
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;
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)
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;
}
//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;
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];
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);
#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 };
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))
struct usbdrv_private *macp;
dev = dev_inst;
- macp = dev->priv;
+ macp = dev->ml_priv;
/* Read register error, card may be unpluged */
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;
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 +
struct usbdrv_private *macp;
int rc = -1;
- macp = dev->priv;
+ macp = dev->ml_priv;
read_lock(&(macp->isolate_lock));
if (macp->driver_isolated) {
{
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");
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 */
*/
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)
if (!(dev = (struct net_device *) pci_get_drvdata(pcid)))
return;
- macp = dev->priv;
+ macp = dev->ml_priv;
unregister_netdev(dev);
usbdrv_clear_structs(dev);
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);
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);
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;
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;
{
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)
{
#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)
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);
#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;
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;
}
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)
{
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;
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;
}
{
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)
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);
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));
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));
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));
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;
}
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));
{
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));
{
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));
{
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;
}
#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;
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){
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,
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;
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,
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
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));
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");
{
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);
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)
/************************************************************************/
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))
/************************************************************************/
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)
{
SET_MODULE_OWNER(net);
#endif
- net->priv = macp; //kernel 2.6
+ net->ml_priv = macp; //kernel 2.6
macp->udev = dev;
macp->device = net;