#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
- dev = alloc_etherdev(0);
+ dev = alloc_etherdev(sizeof(DEVICE_INFO));
#else
dev = init_etherdev(dev, 0);
#endif
+ pDevice = (PSDevice) netdev_priv(dev);
+
if (dev == NULL) {
printk(KERN_ERR DEVICE_NAME ": allocate net device failed \n");
return -ENODEV;
pDevice->dev = dev;
pDevice->next_module = root_device_dev;
root_device_dev = dev;
- dev->priv = pDevice;
dev->irq = pcid->irq;
if (pci_enable_device(pcid)) {
printk("Fail to Register WPADEV?\n");
unregister_netdev(pDevice->dev);
free_netdev(dev);
- kfree(pDevice);
}
device_print_info(pDevice);
pci_set_drvdata(pcid, pDevice);
PSDevice p;
- *ppDevice = kmalloc(sizeof(DEVICE_INFO),GFP_ATOMIC);
-
- if (*ppDevice == NULL)
- return FALSE;
-
memset(*ppDevice,0,sizeof(DEVICE_INFO));
if (pDevice_Infos == NULL) {
if (pDevice->pcid) {
pci_set_drvdata(pDevice->pcid,NULL);
}
- kfree(pDevice);
-
}
#endif// ifndef PRIVATE_OBJ
#else
static int device_open(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
int i;
#endif
pDevice->rx_buf_sz = PKT_BUF_SZ;
#else
static int device_close(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
//PLICE_DEBUG->
static int device_dma0_tx_80211(struct sk_buff *skb, struct net_device *dev) {
- PSDevice pDevice=dev->priv;
+ PSDevice pDevice=netdev_priv(dev);
#endif
PBYTE pbMPDU;
UINT cbMPDULen = 0;
#else
static int device_xmit(struct sk_buff *skb, struct net_device *dev) {
- PSDevice pDevice=dev->priv;
+ PSDevice pDevice=netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
#else
static irqreturn_t device_intr(int irq, void *dev_instance) {
struct net_device* dev=dev_instance;
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
int max_count=0;
#else
static void device_set_multi(struct net_device *dev) {
- PSDevice pDevice = (PSDevice) dev->priv;
+ PSDevice pDevice = (PSDevice) netdev_priv(dev);
#endif
PSMgmtObject pMgmt = pDevice->pMgmt;
#else
static struct net_device_stats *device_get_stats(struct net_device *dev) {
- PSDevice pDevice=(PSDevice) dev->priv;
+ PSDevice pDevice=(PSDevice) netdev_priv(dev);
#endif
return &pDevice->stats;
#else
static int device_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) {
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
#endif
#ifdef WIRELESS_EXT
PSDevice_info pDevice_info = (PSDevice_info)pExDevice;
PSDevice pDevice;
-
pDevice = (PSDevice)kmalloc(sizeof(DEVICE_INFO), (int)GFP_ATOMIC);
if (pDevice == NULL)
return FALSE;
struct iw_statistics *iwctl_get_wireless_stats(struct net_device *dev)
{
- PSDevice pDevice = dev->priv;
+ PSDevice pDevice = netdev_priv(dev);
long ldBm;
pDevice->wstats.status = pDevice->eOPMode;
#ifdef Calcu_LinkQual
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
struct iw_scan_req *req = (struct iw_scan_req *)extra;
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
BYTE abyScanSSID[WLAN_IEHDR_LEN + WLAN_SSID_MAXLEN + 1];
char *extra)
{
int ii, jj, kk;
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PKnownBSS pBSS;
PWLAN_IE_SSID pItemSSID;
struct iw_freq *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWFREQ \n");
struct iw_freq *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFREQ \n");
__u32 *wmode,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
__u32 *wmode,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct sockaddr *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
BYTE ZeroBSSID[WLAN_BSSID_LEN]={0x00,0x00,0x00,0x00,0x00,0x00};
struct sockaddr *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ii,jj, rc = 0;
struct sockaddr sock[IW_MAX_AP];
struct iw_quality qual[IW_MAX_AP];
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PWLAN_IE_SSID pItemSSID;
//2008-0409-05, <Add> by Einsn Liu
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
PWLAN_IE_SSID pItemSSID;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
u8 brate = 0;
int i;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
//2007-0118-05,<Mark> by EinsnLiu
//Mark the unnecessary sentences.
// PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCSIWRTS \n");
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRTS \n");
wrq->value = pDevice->wRTSThreshold;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
int fthr = wrq->value;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWFRAG \n");
wrq->value = pDevice->wFragmentationThreshold;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
int rc = 0;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWRETRY \n");
wrq->disabled = 0; // Can't be disabled
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
DWORD dwKeyIndex = (DWORD)(wrq->flags & IW_ENCODE_INDEX);
int ii,uu, rc = 0;
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
char abyKey[WLAN_WEP232_KEYLEN];
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
char abyKey[WLAN_WEP232_KEYLEN];
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int rc = 0;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int mode = pDevice->ePSMode;
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
long ldBm;
DEVICE_PRT(MSG_LEVEL_DEBUG, KERN_INFO " SIOCGIWSENS \n");
struct iw_param *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
static int wpa_version=0; //must be static to save the last value,einsn liu
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
int ret=0;
int space = wrq->length;
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
struct iw_encode_ext *ext = (struct iw_encode_ext*)extra;
struct viawget_wpa_param *param=NULL;
//original member
struct iw_point *wrq,
char *extra)
{
- PSDevice pDevice = (PSDevice)dev->priv;
+ PSDevice pDevice = (PSDevice)netdev_priv(dev);
PSMgmtObject pMgmt = &(pDevice->sMgmtObj);
struct iw_mlme *mlme = (struct iw_mlme *)extra;
//u16 reason = cpu_to_le16(mlme->reason_code);