Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
David S. Miller [Wed, 2 Sep 2009 07:32:56 +0000 (00:32 -0700)]
Conflicts:
drivers/net/yellowfin.c

31 files changed:
1  2 
drivers/net/Kconfig
drivers/net/arm/w90p910_ether.c
drivers/net/b44.c
drivers/net/bnx2.c
drivers/net/bnx2.h
drivers/net/cnic.c
drivers/net/e100.c
drivers/net/e1000e/netdev.c
drivers/net/gianfar.c
drivers/net/ibm_newemac/core.c
drivers/net/irda/au1k_ir.c
drivers/net/irda/pxaficp_ir.c
drivers/net/irda/sa1100_ir.c
drivers/net/ixp2000/ixpdev.c
drivers/net/macb.c
drivers/net/mlx4/en_tx.c
drivers/net/smc91x.c
drivers/net/tulip/tulip_core.c
drivers/net/ucc_geth.c
drivers/net/via-rhine.c
drivers/net/via-velocity.c
drivers/net/virtio_net.c
drivers/net/wireless/ipw2x00/ipw2200.c
drivers/net/wireless/orinoco/hw.c
drivers/net/wireless/rtl818x/rtl8187_dev.c
drivers/net/yellowfin.c
include/net/sch_generic.h
net/core/netpoll.c
net/core/sock.c
net/ipv4/ip_gre.c
net/ipv6/af_inet6.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -67,9 -68,9 +68,9 @@@ static int ixpdev_xmit(struct sk_buff *
        ip->tx_queue_entries++;
        if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN)
                netif_stop_queue(dev);
-       local_irq_enable();
+       local_irq_restore(flags);
  
 -      return 0;
 +      return NETDEV_TX_OK;
  }
  
  
Simple merge
Simple merge
@@@ -655,10 -659,10 +659,10 @@@ static int smc_hard_start_xmit(struct s
                dev->stats.tx_errors++;
                dev->stats.tx_dropped++;
                dev_kfree_skb(skb);
 -              return 0;
 +              return NETDEV_TX_OK;
        }
  
-       smc_special_lock(&lp->lock);
+       smc_special_lock(&lp->lock, flags);
  
        /* now, try to allocate the memory */
        SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages);
Simple merge
@@@ -3144,9 -3172,9 +3145,9 @@@ static int ucc_geth_start_xmit(struct s
        uccf = ugeth->uccf;
        out_be16(uccf->p_utodr, UCC_FAST_TOD);
  #endif
-       spin_unlock_irq(&ugeth->lock);
+       spin_unlock_irqrestore(&ugeth->lock, flags);
  
 -      return 0;
 +      return NETDEV_TX_OK;
  }
  
  static int ucc_geth_rx(struct ucc_geth_private *ugeth, u8 rxQ, int rx_work_limit)
Simple merge
@@@ -1742,167 -1375,61 +1742,167 @@@ static void velocity_free_td_ring(struc
        }
  }
  
 +
 +static void velocity_free_rings(struct velocity_info *vptr)
 +{
 +      velocity_free_td_ring(vptr);
 +      velocity_free_rd_ring(vptr);
 +      velocity_free_dma_rings(vptr);
 +}
 +
  /**
 - *    velocity_rx_srv         -       service RX interrupt
 + *    velocity_error  -       handle error from controller
   *    @vptr: velocity
 - *    @status: adapter status (unused)
 + *    @status: card status
 + *
 + *    Process an error report from the hardware and attempt to recover
 + *    the card itself. At the moment we cannot recover from some
 + *    theoretically impossible errors but this could be fixed using
 + *    the pci_device_failed logic to bounce the hardware
   *
 - *    Walk the receive ring of the velocity adapter and remove
 - *    any received packets from the receive queue. Hand the ring
 - *    slots back to the adapter for reuse.
   */
 -
 -static int velocity_rx_srv(struct velocity_info *vptr, int status)
 +static void velocity_error(struct velocity_info *vptr, int status)
  {
 -      struct net_device_stats *stats = &vptr->dev->stats;
 -      int rd_curr = vptr->rx.curr;
 -      int works = 0;
  
 -      do {
 -              struct rx_desc *rd = vptr->rx.ring + rd_curr;
 +      if (status & ISR_TXSTLI) {
 +              struct mac_regs __iomem *regs = vptr->mac_regs;
  
 -              if (!vptr->rx.info[rd_curr].skb)
 -                      break;
 +              printk(KERN_ERR "TD structure error TDindex=%hx\n", readw(&regs->TDIdx[0]));
 +              BYTE_REG_BITS_ON(TXESR_TDSTR, &regs->TXESR);
 +              writew(TRDCSR_RUN, &regs->TDCSRClr);
 +              netif_stop_queue(vptr->dev);
  
 -              if (rd->rdesc0.len & OWNED_BY_NIC)
 -                      break;
 +              /* FIXME: port over the pci_device_failed code and use it
 +                 here */
 +      }
  
 -              rmb();
 +      if (status & ISR_SRCI) {
 +              struct mac_regs __iomem *regs = vptr->mac_regs;
 +              int linked;
 +
 +              if (vptr->options.spd_dpx == SPD_DPX_AUTO) {
 +                      vptr->mii_status = check_connection_type(regs);
  
 +                      /*
 +                       *      If it is a 3119, disable frame bursting in
 +                       *      halfduplex mode and enable it in fullduplex
 +                       *       mode
 +                       */
 +                      if (vptr->rev_id < REV_ID_VT3216_A0) {
-                               if (vptr->mii_status | VELOCITY_DUPLEX_FULL)
++                              if (vptr->mii_status & VELOCITY_DUPLEX_FULL)
 +                                      BYTE_REG_BITS_ON(TCR_TB2BDIS, &regs->TCR);
 +                              else
 +                                      BYTE_REG_BITS_OFF(TCR_TB2BDIS, &regs->TCR);
 +                      }
 +                      /*
 +                       *      Only enable CD heart beat counter in 10HD mode
 +                       */
 +                      if (!(vptr->mii_status & VELOCITY_DUPLEX_FULL) && (vptr->mii_status & VELOCITY_SPEED_10))
 +                              BYTE_REG_BITS_OFF(TESTCFG_HBDIS, &regs->TESTCFG);
 +                      else
 +                              BYTE_REG_BITS_ON(TESTCFG_HBDIS, &regs->TESTCFG);
 +              }
                /*
 -               *      Don't drop CE or RL error frame although RXOK is off
 +               *      Get link status from PHYSR0
                 */
 -              if (rd->rdesc0.RSR & (RSR_RXOK | RSR_CE | RSR_RL)) {
 -                      if (velocity_receive_frame(vptr, rd_curr) < 0)
 -                              stats->rx_dropped++;
 -              } else {
 -                      if (rd->rdesc0.RSR & RSR_CRC)
 -                              stats->rx_crc_errors++;
 -                      if (rd->rdesc0.RSR & RSR_FAE)
 -                              stats->rx_frame_errors++;
 +              linked = readb(&regs->PHYSR0) & PHYSR0_LINKGD;
  
 -                      stats->rx_dropped++;
 +              if (linked) {
 +                      vptr->mii_status &= ~VELOCITY_LINK_FAIL;
 +                      netif_carrier_on(vptr->dev);
 +              } else {
 +                      vptr->mii_status |= VELOCITY_LINK_FAIL;
 +                      netif_carrier_off(vptr->dev);
                }
  
 -              rd->size |= RX_INTEN;
 +              velocity_print_link_status(vptr);
 +              enable_flow_control_ability(vptr);
  
 -              rd_curr++;
 -              if (rd_curr >= vptr->options.numrx)
 -                      rd_curr = 0;
 -      } while (++works <= 15);
 +              /*
 +               *      Re-enable auto-polling because SRCI will disable
 +               *      auto-polling
 +               */
  
 -      vptr->rx.curr = rd_curr;
 +              enable_mii_autopoll(regs);
  
 -      if ((works > 0) && (velocity_rx_refill(vptr) > 0))
 -              velocity_give_many_rx_descs(vptr);
 +              if (vptr->mii_status & VELOCITY_LINK_FAIL)
 +                      netif_stop_queue(vptr->dev);
 +              else
 +                      netif_wake_queue(vptr->dev);
  
 -      VAR_USED(stats);
 +      };
 +      if (status & ISR_MIBFI)
 +              velocity_update_hw_mibs(vptr);
 +      if (status & ISR_LSTEI)
 +              mac_rx_queue_wake(vptr->mac_regs);
 +}
 +
 +/**
 + *    tx_srv          -       transmit interrupt service
 + *    @vptr; Velocity
 + *    @status:
 + *
 + *    Scan the queues looking for transmitted packets that
 + *    we can complete and clean up. Update any statistics as
 + *    necessary/
 + */
 +static int velocity_tx_srv(struct velocity_info *vptr, u32 status)
 +{
 +      struct tx_desc *td;
 +      int qnum;
 +      int full = 0;
 +      int idx;
 +      int works = 0;
 +      struct velocity_td_info *tdinfo;
 +      struct net_device_stats *stats = &vptr->dev->stats;
 +
 +      for (qnum = 0; qnum < vptr->tx.numq; qnum++) {
 +              for (idx = vptr->tx.tail[qnum]; vptr->tx.used[qnum] > 0;
 +                      idx = (idx + 1) % vptr->options.numtx) {
 +
 +                      /*
 +                       *      Get Tx Descriptor
 +                       */
 +                      td = &(vptr->tx.rings[qnum][idx]);
 +                      tdinfo = &(vptr->tx.infos[qnum][idx]);
 +
 +                      if (td->tdesc0.len & OWNED_BY_NIC)
 +                              break;
 +
 +                      if ((works++ > 15))
 +                              break;
 +
 +                      if (td->tdesc0.TSR & TSR0_TERR) {
 +                              stats->tx_errors++;
 +                              stats->tx_dropped++;
 +                              if (td->tdesc0.TSR & TSR0_CDH)
 +                                      stats->tx_heartbeat_errors++;
 +                              if (td->tdesc0.TSR & TSR0_CRS)
 +                                      stats->tx_carrier_errors++;
 +                              if (td->tdesc0.TSR & TSR0_ABT)
 +                                      stats->tx_aborted_errors++;
 +                              if (td->tdesc0.TSR & TSR0_OWC)
 +                                      stats->tx_window_errors++;
 +                      } else {
 +                              stats->tx_packets++;
 +                              stats->tx_bytes += tdinfo->skb->len;
 +                      }
 +                      velocity_free_tx_buf(vptr, tdinfo);
 +                      vptr->tx.used[qnum]--;
 +              }
 +              vptr->tx.tail[qnum] = idx;
 +
 +              if (AVAIL_TD(vptr, qnum) < 1)
 +                      full = 1;
 +      }
 +      /*
 +       *      Look to see if we should kick the transmit network
 +       *      layer for more work.
 +       */
 +      if (netif_queue_stopped(vptr->dev) && (full == 0)
 +          && (!(vptr->mii_status & VELOCITY_LINK_FAIL))) {
 +              netif_wake_queue(vptr->dev);
 +      }
        return works;
  }
  
Simple merge
@@@ -642,9 -68,9 +642,9 @@@ int orinoco_hw_get_tkip_iv(struct orino
  {
        hermes_t *hw = &priv->hw;
        int err = 0;
 -      u8 tsc_arr[4][IW_ENCODE_SEQ_MAX_SIZE];
 +      u8 tsc_arr[4][ORINOCO_SEQ_LEN];
  
-       if ((key < 0) || (key > 4))
+       if ((key < 0) || (key >= 4))
                return -EINVAL;
  
        err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV,
@@@ -346,9 -346,8 +346,9 @@@ static int netdev_ioctl(struct net_devi
  static int yellowfin_open(struct net_device *dev);
  static void yellowfin_timer(unsigned long data);
  static void yellowfin_tx_timeout(struct net_device *dev);
- static void yellowfin_init_ring(struct net_device *dev);
+ static int yellowfin_init_ring(struct net_device *dev);
 -static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev);
 +static netdev_tx_t yellowfin_start_xmit(struct sk_buff *skb,
 +                                      struct net_device *dev);
  static irqreturn_t yellowfin_interrupt(int irq, void *dev_instance);
  static int yellowfin_rx(struct net_device *dev);
  static void yellowfin_error(struct net_device *dev, int intr_status);
@@@ -806,11 -813,10 +814,11 @@@ static int yellowfin_init_ring(struct n
  }
  #endif
        yp->tx_tail_desc = &yp->tx_status[0];
-       return;
+       return 0;
  }
  
 -static int yellowfin_start_xmit(struct sk_buff *skb, struct net_device *dev)
 +static netdev_tx_t yellowfin_start_xmit(struct sk_buff *skb,
 +                                      struct net_device *dev)
  {
        struct yellowfin_private *yp = netdev_priv(dev);
        unsigned entry;
Simple merge
Simple merge
diff --cc net/core/sock.c
Simple merge
Simple merge
Simple merge