]> nv-tegra.nvidia Code Review - linux-2.6.git/blobdiff - drivers/net/3c527.c
usb: cdc_ether: Add new product id for the 5AE profile
[linux-2.6.git] / drivers / net / 3c527.c
index 6021e6dded8fad4bbc18fcf6b160d2e21c42cf16..d9d056d207f318644c176f3d524fd6029994e7b7 100644 (file)
@@ -51,7 +51,7 @@ DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Richard Procter <rnp@paradise.net.
  *     circular buffer queues.
  *
  *     The mailboxes can be used for controlling how the card traverses
- *     its buffer rings, but are used only for inital setup in this
+ *     its buffer rings, but are used only for initial setup in this
  *     implementation.  The exec mailbox allows a variety of commands to
  *     be executed. Each command must complete before the next is
  *     executed. Primarily we use the exec mailbox for controlling the
@@ -317,13 +317,13 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
        u8 POS;
        u32 base;
        struct mc32_local *lp = netdev_priv(dev);
-       static u16 mca_io_bases[]={
+       static const u16 mca_io_bases[] = {
                0x7280,0x7290,
                0x7680,0x7690,
                0x7A80,0x7A90,
                0x7E80,0x7E90
        };
-       static u32 mca_mem_bases[]={
+       static const u32 mca_mem_bases[] = {
                0x00C0000,
                0x00C4000,
                0x00C8000,
@@ -333,7 +333,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
                0x00D8000,
                0x00DC000
        };
-       static char *failures[]={
+       static const char * const failures[] = {
                "Processor instruction",
                "Processor data bus",
                "Processor data bus",
@@ -443,7 +443,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
         *      Grab the IRQ
         */
 
-       err = request_irq(dev->irq, &mc32_interrupt, IRQF_SHARED | IRQF_SAMPLE_RANDOM, DRV_NAME, dev);
+       err = request_irq(dev->irq, mc32_interrupt, IRQF_SHARED, DRV_NAME, dev);
        if (err) {
                release_region(dev->base_addr, MC32_IO_EXTENT);
                pr_err("%s: unable to get IRQ %d.\n", DRV_NAME, dev->irq);
@@ -522,7 +522,7 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
        lp->tx_len              = lp->exec_box->data[9];   /* Transmit list count */
        lp->rx_len              = lp->exec_box->data[11];  /* Receive list count */
 
-       init_MUTEX_LOCKED(&lp->cmd_mutex);
+       sema_init(&lp->cmd_mutex, 0);
        init_completion(&lp->execution_cmd);
        init_completion(&lp->xceiver_cmd);
 
@@ -729,14 +729,14 @@ static void mc32_halt_transceiver(struct net_device *dev)
  *     mc32_load_rx_ring       -       load the ring of receive buffers
  *     @dev: 3c527 to build the ring for
  *
- *     This initalises the on-card and driver datastructures to
+ *     This initialises the on-card and driver datastructures to
  *     the point where mc32_start_transceiver() can be called.
  *
  *     The card sets up the receive ring for us. We are required to use the
  *     ring it provides, although the size of the ring is configurable.
  *
  *     We allocate an sk_buff for each ring entry in turn and
- *     initalise its house-keeping info. At the same time, we read
+ *     initialise its house-keeping info. At the same time, we read
  *     each 'next' pointer in our rx_ring array. This reduces slow
  *     shared-memory reads and makes it easy to access predecessor
  *     descriptors.
@@ -813,7 +813,7 @@ static void mc32_flush_rx_ring(struct net_device *dev)
  *
  *     This sets up the host transmit data-structures.
  *
- *     First, we obtain from the card it's current postion in the tx
+ *     First, we obtain from the card it's current position in the tx
  *     ring, so that we will know where to begin transmitting
  *     packets.
  *
@@ -1168,8 +1168,8 @@ static void mc32_rx_ring(struct net_device *dev)
 
                        /* Try to save time by avoiding a copy on big frames */
 
-                       if ((length > RX_COPYBREAK)
-                           && ((newskb=dev_alloc_skb(1532)) != NULL))
+                       if ((length > RX_COPYBREAK) &&
+                           ((newskb=dev_alloc_skb(1532)) != NULL))
                        {
                                skb=lp->rx_ring[rx_ring_tail].skb;
                                skb_put(skb, length);
@@ -1526,32 +1526,29 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
 
        if ((dev->flags&IFF_PROMISC) ||
            (dev->flags&IFF_ALLMULTI) ||
-           dev->mc_count > 10)
+           netdev_mc_count(dev) > 10)
                /* Enable promiscuous mode */
                filt |= 1;
-       else if(dev->mc_count)
+       else if (!netdev_mc_empty(dev))
        {
                unsigned char block[62];
                unsigned char *bp;
-               struct dev_mc_list *dmc=dev->mc_list;
-
-               int i;
+               struct netdev_hw_addr *ha;
 
                if(retry==0)
                        lp->mc_list_valid = 0;
                if(!lp->mc_list_valid)
                {
                        block[1]=0;
-                       block[0]=dev->mc_count;
+                       block[0]=netdev_mc_count(dev);
                        bp=block+2;
 
-                       for(i=0;i<dev->mc_count;i++)
-                       {
-                               memcpy(bp, dmc->dmi_addr, 6);
+                       netdev_for_each_mc_addr(ha, dev) {
+                               memcpy(bp, ha->addr, 6);
                                bp+=6;
-                               dmc=dmc->next;
                        }
-                       if(mc32_command_nowait(dev, 2, block, 2+6*dev->mc_count)==-1)
+                       if(mc32_command_nowait(dev, 2, block,
+                                              2+6*netdev_mc_count(dev))==-1)
                        {
                                lp->mc_reload_wait = 1;
                                return;