]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
Merge branch 'for-paul-38-rebased' of git://gitorious.org/linux-omap-dss2/linux
[mv-sheeva.git] / drivers / staging / ft1000 / ft1000-usb / ft1000_hw.c
index b41884e60d073a0ffe49690871500ed819c5c0c6..643a63794ade5351676db4e35344d1e117253f73 100644 (file)
@@ -41,7 +41,6 @@ static int ft1000_chkcard (struct ft1000_device *dev);
 //Jim
 
 static u8 tempbuffer[1600];
-static unsigned long gCardIndex;
 
 #define MAX_RCV_LOOP   100
 
@@ -773,8 +772,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
        int i, ret_val;
        struct list_head *cur, *tmp;
        char card_nr[2];
-
-       gCardIndex=0; //mbelian
+       unsigned long gCardIndex = 0;
 
     DEBUG("Enter init_ft1000_netdev...\n");
 
@@ -786,7 +784,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
        return -ENOMEM;
     }
 
-       pInfo = (struct ft1000_info *) netdev_priv(netdev);
+       pInfo = netdev_priv(netdev);
 
     //DEBUG("init_ft1000_netdev: gFt1000Info=%x, netdev=%x, ft1000dev=%x\n", gFt1000Info, netdev, ft1000dev);
 
@@ -794,9 +792,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
 
     dev_alloc_name(netdev, netdev->name);
 
-    //for the first inserted card, decide the card index beginning number, in case there are existing network interfaces
-    if ( gCardIndex == 0 )
-    {
         DEBUG("init_ft1000_netdev: network device name is %s\n", netdev->name);
 
        if ( strncmp(netdev->name,"eth", 3) == 0) {
@@ -816,13 +811,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
                ret_val = -ENXIO;
                goto err_net;
         }
-    }
-    else
-    {
-        //not the first inserted card, increase card number by 1
-        pInfo->CardNumber = gCardIndex;
-        /*DEBUG("card number = %d\n", pInfo->CardNumber);*/ //mbelian
-    }
 
     memset(&pInfo->stats, 0, sizeof(struct net_device_stats) );
 
@@ -835,7 +823,6 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
     pInfo->mediastate = 0;
     pInfo->fifo_cnt = 0;
     pInfo->DeviceCreated = FALSE;
-    pInfo->DeviceMajor = 0;
     pInfo->CurrentInterruptEnableMask = ISR_DEFAULT_MASK;
     pInfo->InterruptsEnabled = FALSE;
     pInfo->CardReady = 0;
@@ -851,6 +838,7 @@ u16 init_ft1000_netdev(struct ft1000_device *ft1000dev)
 
     INIT_LIST_HEAD(&pInfo->prov_list);
 
+       INIT_LIST_HEAD(&pInfo->nodes.list);
 //mbelian
 #ifdef HAVE_NET_DEVICE_OPS
        netdev->netdev_ops = &ftnet_ops;
@@ -952,7 +940,7 @@ int reg_ft1000_netdev(struct ft1000_device *ft1000dev, struct usb_interface *int
 
 
     //Create character device, implemented by Jim
-    ft1000_CreateDevice(ft1000dev);
+    ft1000_create_dev(ft1000dev);
 
     DEBUG ("reg_ft1000_netdev returned\n");
 
@@ -1345,7 +1333,7 @@ static int ft1000_submit_rx_urb(struct ft1000_info *info)
 //---------------------------------------------------------------------------
 static int ft1000_open (struct net_device *dev)
 {
-       struct ft1000_info *pInfo = (struct ft1000_info *)netdev_priv(dev);
+       struct ft1000_info *pInfo = netdev_priv(dev);
     struct timeval tv; //mbelian
        int ret;
 
@@ -1386,7 +1374,7 @@ static int ft1000_open (struct net_device *dev)
 //---------------------------------------------------------------------------
 int ft1000_close(struct net_device *net)
 {
-       struct ft1000_info *pInfo = (struct ft1000_info *) netdev_priv(net);
+       struct ft1000_info *pInfo = netdev_priv(net);
     struct ft1000_device *ft1000dev = pInfo->pFt1000Dev;
 
     //DEBUG ("ft1000_close: netdev->refcnt=%d\n", net->refcnt);
@@ -1409,7 +1397,7 @@ int ft1000_close(struct net_device *net)
 
 static struct net_device_stats *ft1000_netdev_stats(struct net_device *dev)
 {
-       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev);
+       struct ft1000_info *info = netdev_priv(dev);
 
        return &(info->stats); //mbelian
 }
@@ -1435,7 +1423,7 @@ Jim
 static int ft1000_chkcard (struct ft1000_device *dev) {
     u16 tempword;
     u16 status;
-       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+       struct ft1000_info *info = netdev_priv(dev->net);
 
     if (info->fCondResetPend)
     {
@@ -1535,7 +1523,7 @@ static bool ft1000_receive_cmd (struct ft1000_device *dev, u16 *pbuffer, int max
 static int ft1000_dsp_prov(void *arg)
 {
     struct ft1000_device *dev = (struct ft1000_device *)arg;
-       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+       struct ft1000_info *info = netdev_priv(dev->net);
     u16 tempword;
     u16 len;
     u16 i=0;
@@ -1618,7 +1606,7 @@ static int ft1000_dsp_prov(void *arg)
 
 
 static int ft1000_proc_drvmsg (struct ft1000_device *dev, u16 size) {
-       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+       struct ft1000_info *info = netdev_priv(dev->net);
     u16 msgtype;
     u16 tempword;
        struct media_msg *pmediamsg;
@@ -1901,7 +1889,7 @@ out:
 int ft1000_poll(void* dev_id) {
 
     struct ft1000_device *dev = (struct ft1000_device *)dev_id;
-       struct ft1000_info *info = (struct ft1000_info *) netdev_priv(dev->net);
+       struct ft1000_info *info = netdev_priv(dev->net);
 
     u16 tempword;
     u16 status;