wl1251: Add kernel 2.6.32 support

Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
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 9770803..5e97899 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
@@ -150,7 +150,27 @@
 static int tiwlan_drv_net_open(struct net_device * dev);
 static int tiwlan_drv_net_stop(struct net_device * dev);
 static int tiwlan_drv_net_xmit(struct sk_buff * skb, struct net_device * dev);
+static int tiwlan_drv_dummy_net_xmit(struct sk_buff * skb, struct net_device * dev);
 static struct net_device_stats * tiwlan_drv_net_get_stats(struct net_device * dev);
+int ti1610_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
+
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 31))
+static struct net_device_ops tiwlan_ops_pri = {
+	.ndo_open = tiwlan_drv_net_open,
+	.ndo_stop = tiwlan_drv_net_stop,
+	.ndo_get_stats = tiwlan_drv_net_get_stats,
+	.ndo_do_ioctl = ti1610_do_ioctl,
+	.ndo_start_xmit = tiwlan_drv_net_xmit,
+};
+
+static struct net_device_ops tiwlan_ops_dummy = {
+	.ndo_open = tiwlan_drv_net_open,
+	.ndo_stop = tiwlan_drv_net_stop,
+	.ndo_get_stats = tiwlan_drv_net_get_stats,
+	.ndo_do_ioctl = ti1610_do_ioctl,
+	.ndo_start_xmit = tiwlan_drv_dummy_net_xmit,
+};
+#endif
 
 #define OS_WRITE_REG(drv,reg,val)   \
     os_hwWriteMemRegisterUINT32(drv, (UINT32 *)((unsigned long)drv->acx_reg.va + reg), (__u32)(val))
@@ -763,10 +783,14 @@
     drv->netdev = dev;
     strcpy(dev->name, TIWLAN_DRV_IF_NAME);
     netif_carrier_off(dev);
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31))
     dev->open = tiwlan_drv_net_open;
     dev->stop = tiwlan_drv_net_stop;
     dev->hard_start_xmit = tiwlan_drv_dummy_net_xmit;
     dev->get_stats = tiwlan_drv_net_get_stats;
+#else
+    dev->netdev_ops = &tiwlan_ops_dummy;
+#endif
     dev->tx_queue_len = 100;
 
     res = tiwlan_ioctl_init(dev);
@@ -1412,7 +1436,11 @@
         }
 
         /* Finalize network interface setup */
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31))
         drv->netdev->hard_start_xmit = tiwlan_drv_net_xmit;
+#else
+        drv->netdev->netdev_ops = &tiwlan_ops_pri;
+#endif
         memcpy (drv->netdev->dev_addr, drv->adapter.CurrentAddr, MAC_ADDR_LEN);
         drv->netdev->addr_len = MAC_ADDR_LEN;
 
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 8d70e3c..3d5b7d4 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
@@ -256,8 +256,8 @@
 
 int tiwlan_ioctl_init( struct net_device *dev )
 {
+#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2, 6, 31))
         dev->do_ioctl       = ti1610_do_ioctl;
-
+#endif
         return 0;
 }
-