static int tiwlan_drv_net_open(struct net_device * dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ tiwlan_net_dev_t *drv = *(tiwlan_net_dev_t **)netdev_priv(dev)
ti_nodprintf(TIWLAN_LOG_INFO, "tiwlan_drv_net_open()\n");
*/
static int tiwlan_drv_net_xmit(struct sk_buff *skb, struct net_device *dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ tiwlan_net_dev_t *drv = *(tiwlan_net_dev_t **)netdev_priv(dev);
int status;
mem_MSDU_T *pMsdu;
UINT32 packetHeaderLength;
struct net_device_stats * tiwlan_drv_net_get_stats(struct net_device * dev)
{
- tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv;
+ tiwlan_net_dev_t *drv = *(tiwlan_net_dev_t **)netdev_priv(dev);
ti_dprintf(TIWLAN_LOG_OTHER, "tiwlan_drv_net_get_stats()\n");
return &drv->stats;
struct net_device *dev;
int res;
- dev = alloc_etherdev(0);
+ dev = alloc_etherdev(sizeof(tiwlan_net_dev_t *));
if (dev == NULL)
{
ti_dprintf(TIWLAN_LOG_ERROR, "alloc_etherdev() failed\n");
return -ENOMEM;
}
ether_setup(dev);
- dev->priv = drv;
+ *(tiwlan_net_dev_t **)netdev_priv(dev) = drv;
drv->netdev = dev;
strcpy(dev->name, TIWLAN_DRV_IF_NAME);
netif_carrier_off(dev);
switch( req->cmd ) {
case TIWLN_DRIVER_STATUS_SET:
if(*data)
- res = tiwlan_start_drv( (tiwlan_net_dev_t *)dev->priv );
+ res = tiwlan_start_drv( *(tiwlan_net_dev_t **)netdev_priv(dev) );
else
- res = tiwlan_stop_drv( (tiwlan_net_dev_t *)dev->priv );
+ res = tiwlan_stop_drv( *(tiwlan_net_dev_t **)netdev_priv(dev) );
if( res == OK )
drv_started = !drv_started;
int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
+ tiwlan_net_dev_t *net_dev = *(tiwlan_net_dev_t **)netdev_priv(dev);
tiioctl_req_t *req = (tiioctl_req_t *) &rq->ifr_ifru;
char *extra, *kbuf = NULL;
int res, aval_data_size = ((char *) req + sizeof(*req)) - (char *)&req->user_data_pointer; /* = ~4 bytes */
req->user_data_pointer, req->length, aval_data_size );
/* driver is already initialized */
- if ((req->cmd == TIWLN_SET_INIT_INFO) && (((tiwlan_net_dev_t *)dev->priv)->adapter.CoreHalCtx))
+ if ((req->cmd == TIWLN_SET_INIT_INFO) && net_dev->adapter.CoreHalCtx)
{
return 0;
}
init_info?init_info->eeprom_image_length:0,
init_info?init_info->init_file_length:0,
init_info?init_info->firmware_image_length:0 );
- res = tiwlan_init_drv((tiwlan_net_dev_t *)dev->priv, init_info);
+ res = tiwlan_init_drv(net_dev, init_info);
}
#ifdef DRIVER_PROFILING
else if (req->cmd == TIWLAN_PROFILING_REPORT)
{
- res = tiwlan_profile_report((tiwlan_net_dev_t *)dev->priv);
+ res = tiwlan_profile_report(net_dev);
}
else if (req->cmd == TIWLAN_PROFILING_CPU_ESTIMATOR_CMD) {
/* get the command cpu estimator command parameter */
switch (command_type)
{
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_START:
- res = tiwlan_profile_cpu_usage_estimator_start((tiwlan_net_dev_t *)dev->priv,
+ res = tiwlan_profile_cpu_usage_estimator_start(net_dev,
/* the data in this case is the estimator
resolution in milliseconds */
command_data * 1000);
break;
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_STOP:
- res = tiwlan_profile_cpu_usage_estimator_stop((tiwlan_net_dev_t *)dev->priv);
+ res = tiwlan_profile_cpu_usage_estimator_stop(net_dev);
break;
case TIWLAN_PROFILING_CPU_ESTIMATOR_CMD_RESET:
- res =tiwlan_profile_cpu_usage_estimator_reset((tiwlan_net_dev_t *)dev->priv);
+ res =tiwlan_profile_cpu_usage_estimator_reset(net_dev);
break;
default:
res = 0;
else
{
- res = tiwlan_send_wait_reply((tiwlan_net_dev_t *)dev->priv, ti1610_ioctl_priv_proc_tl,
+ res = tiwlan_send_wait_reply(net_dev, ti1610_ioctl_priv_proc_tl,
(unsigned long)req, (unsigned long)extra, 0, 0);
}