diff options
author | Dmitry Shmidt <> | 2009-04-21 15:16:19 -0700 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-04-21 15:16:19 -0700 |
commit | 3fc3497ba9725629167c84c2d5e5633b1aad367a (patch) | |
tree | bbb59da13917301dfa0fd8cee7b9ee4dbffa2be6 | |
parent | 16fe14c8fe9dadadfa29f47d8d2ebf3777d08148 (diff) | |
download | ti-3fc3497ba9725629167c84c2d5e5633b1aad367a.tar.gz |
AI 147254: Add kernel 2.6.29 support
BUG=1798203
Automated import of CL 147254
-rw-r--r-- | sta_dk_4_0_4_32/pform/linux/inc/esta_drv.h | 8 | ||||
-rw-r--r-- | sta_dk_4_0_4_32/pform/linux/src/esta_drv.c | 8 | ||||
-rw-r--r-- | sta_dk_4_0_4_32/pform/linux/src/ioctl_list.c | 18 | ||||
-rw-r--r-- | sta_dk_4_0_4_32/pform/linux/src/osapi.c | 2 |
4 files changed, 22 insertions, 14 deletions
diff --git a/sta_dk_4_0_4_32/pform/linux/inc/esta_drv.h b/sta_dk_4_0_4_32/pform/linux/inc/esta_drv.h index b21efe3..dafe07b 100644 --- a/sta_dk_4_0_4_32/pform/linux/inc/esta_drv.h +++ b/sta_dk_4_0_4_32/pform/linux/inc/esta_drv.h @@ -78,6 +78,14 @@ #define TIWLAN_DRV_NAME_WIRELESS_PROTO "IEEE 802.11-DS" #define TIWLAN_DBG_PROC "wifidbg" +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) +#define NETDEV_SET_PRIVATE(dev, drv) dev->priv = drv +#define NETDEV_GET_PRIVATE(dev) dev->priv +#else +#define NETDEV_SET_PRIVATE(dev, drv) dev->ml_priv = drv +#define NETDEV_GET_PRIVATE(dev) dev->ml_priv +#endif + void *wifi_kernel_prealloc(int section, unsigned long size); #ifdef TIWLAN_MSM7000 diff --git a/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c b/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c index 54aade0..3289b4b 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c +++ b/sta_dk_4_0_4_32/pform/linux/src/esta_drv.c @@ -494,7 +494,7 @@ static int tiwlan_calibration_write_proc(struct file *file, const char *buffer, 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_GET_PRIVATE(dev); ti_nodprintf(TIWLAN_LOG_INFO, "tiwlan_drv_net_open()\n"); @@ -592,7 +592,7 @@ static void tiwlan_xmit_handler( struct work_struct *work ) */ 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_GET_PRIVATE(dev); int status; mem_MSDU_T *pMsdu; UINT32 packetHeaderLength; @@ -740,7 +740,7 @@ static int tiwlan_drv_net_xmit(struct sk_buff *skb, struct net_device *dev) 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_GET_PRIVATE(dev); ti_dprintf(TIWLAN_LOG_OTHER, "tiwlan_drv_net_get_stats()\n"); return &drv->stats; @@ -759,7 +759,7 @@ static int setup_netif(tiwlan_net_dev_t *drv) return -ENOMEM; } ether_setup(dev); - dev->priv = drv; + NETDEV_SET_PRIVATE(dev, drv); drv->netdev = dev; strcpy(dev->name, TIWLAN_DRV_IF_NAME); netif_carrier_off(dev); diff --git a/sta_dk_4_0_4_32/pform/linux/src/ioctl_list.c b/sta_dk_4_0_4_32/pform/linux/src/ioctl_list.c index 5c3fa32..8d70e3c 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/ioctl_list.c +++ b/sta_dk_4_0_4_32/pform/linux/src/ioctl_list.c @@ -100,9 +100,9 @@ int ti1610_ioctl_priv_proc_tl(tiwlan_req_t *req_data) 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_GET_PRIVATE(dev) ); else - res = tiwlan_stop_drv( (tiwlan_net_dev_t *)dev->priv ); + res = tiwlan_stop_drv( (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev) ); if( res == OK ) drv_started = !drv_started; @@ -149,7 +149,7 @@ int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 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) && (((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev))->adapter.CoreHalCtx)) { return 0; } @@ -188,13 +188,13 @@ int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 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((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(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((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev)); } else if (req->cmd == TIWLAN_PROFILING_CPU_ESTIMATOR_CMD) { /* get the command cpu estimator command parameter */ @@ -207,16 +207,16 @@ int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) 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((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(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((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(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((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev)); break; default: res = 0; @@ -228,7 +228,7 @@ int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) else { - res = tiwlan_send_wait_reply((tiwlan_net_dev_t *)dev->priv, ti1610_ioctl_priv_proc_tl, + res = tiwlan_send_wait_reply((tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev), ti1610_ioctl_priv_proc_tl, (unsigned long)req, (unsigned long)extra, 0, 0); } diff --git a/sta_dk_4_0_4_32/pform/linux/src/osapi.c b/sta_dk_4_0_4_32/pform/linux/src/osapi.c index f81cfd7..76f83cd 100644 --- a/sta_dk_4_0_4_32/pform/linux/src/osapi.c +++ b/sta_dk_4_0_4_32/pform/linux/src/osapi.c @@ -1320,7 +1320,7 @@ os_sendPacket( ) { struct net_device *dev = (struct net_device *)OsContext; - tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)dev->priv; + tiwlan_net_dev_t *drv = (tiwlan_net_dev_t *)NETDEV_GET_PRIVATE(dev); INT32 status; mem_MSDU_T* pMsdu; |