~ubuntu-branches/ubuntu/quantal/linux-lowlatency/quantal-proposed

« back to all changes in this revision

Viewing changes to drivers/net/ethernet/via/via-velocity.c

  • Committer: Package Import Robot
  • Author(s): Andy Whitcroft, Andy Whitcroft
  • Date: 2012-06-21 09:16:38 UTC
  • Revision ID: package-import@ubuntu.com-20120621091638-gubhv4nox8xez1ct
Tags: 3.5.0-1.1
[ Andy Whitcroft]

* Rebuild lowlatency against Ubuntu-3.5.0-1.1
* All new configuration system to allow configuration deltas to be
  exposed via debian.lowlatency/config-delta

Show diffs side-by-side

added added

removed removed

Lines of Context:
522
522
        mac_set_vlan_cam_mask(regs, vptr->vCAMmask);
523
523
}
524
524
 
525
 
static void velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
 
525
static int velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid)
526
526
{
527
527
        struct velocity_info *vptr = netdev_priv(dev);
528
528
 
530
530
        set_bit(vid, vptr->active_vlans);
531
531
        velocity_init_cam_filter(vptr);
532
532
        spin_unlock_irq(&vptr->lock);
 
533
        return 0;
533
534
}
534
535
 
535
 
static void velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
 
536
static int velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
536
537
{
537
538
        struct velocity_info *vptr = netdev_priv(dev);
538
539
 
540
541
        clear_bit(vid, vptr->active_vlans);
541
542
        velocity_init_cam_filter(vptr);
542
543
        spin_unlock_irq(&vptr->lock);
 
544
        return 0;
543
545
}
544
546
 
545
547
static void velocity_init_rx_ring_indexes(struct velocity_info *vptr)
1507
1509
        struct rx_desc *rd = &(vptr->rx.ring[idx]);
1508
1510
        struct velocity_rd_info *rd_info = &(vptr->rx.info[idx]);
1509
1511
 
1510
 
        rd_info->skb = dev_alloc_skb(vptr->rx.buf_sz + 64);
 
1512
        rd_info->skb = netdev_alloc_skb(vptr->dev, vptr->rx.buf_sz + 64);
1511
1513
        if (rd_info->skb == NULL)
1512
1514
                return -ENOMEM;
1513
1515
 
2486
2488
 
2487
2489
        if (vptr->flags & VELOCITY_FLAGS_WOL_ENABLED)
2488
2490
                velocity_get_ip(vptr);
2489
 
        if (dev->irq != 0)
2490
 
                free_irq(dev->irq, dev);
 
2491
 
 
2492
        free_irq(vptr->pdev->irq, dev);
2491
2493
 
2492
2494
        velocity_free_rings(vptr);
2493
2495
 
2728
2730
        }
2729
2731
 
2730
2732
        dev = alloc_etherdev(sizeof(struct velocity_info));
2731
 
        if (!dev) {
2732
 
                dev_err(&pdev->dev, "allocate net device failed.\n");
 
2733
        if (!dev)
2733
2734
                goto out;
2734
 
        }
2735
2735
 
2736
2736
        /* Chain it all together */
2737
2737
 
2755
2755
        if (ret < 0)
2756
2756
                goto err_free_dev;
2757
2757
 
2758
 
        dev->irq = pdev->irq;
2759
 
 
2760
2758
        ret = velocity_get_pci_info(vptr, pdev);
2761
2759
        if (ret < 0) {
2762
2760
                /* error message already printed */
2779
2777
 
2780
2778
        mac_wol_reset(regs);
2781
2779
 
2782
 
        dev->base_addr = vptr->ioaddr;
2783
 
 
2784
2780
        for (i = 0; i < 6; i++)
2785
2781
                dev->dev_addr[i] = readb(&regs->PAR[i]);
2786
2782
 
2806
2802
 
2807
2803
        vptr->phy_id = MII_GET_PHY_ID(vptr->mac_regs);
2808
2804
 
2809
 
        dev->irq = pdev->irq;
2810
2805
        dev->netdev_ops = &velocity_netdev_ops;
2811
2806
        dev->ethtool_ops = &velocity_ethtool_ops;
2812
2807
        netif_napi_add(dev, &vptr->napi, velocity_poll, VELOCITY_NAPI_WEIGHT);
3267
3262
static void velocity_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
3268
3263
{
3269
3264
        struct velocity_info *vptr = netdev_priv(dev);
3270
 
        strcpy(info->driver, VELOCITY_NAME);
3271
 
        strcpy(info->version, VELOCITY_VERSION);
3272
 
        strcpy(info->bus_info, pci_name(vptr->pdev));
 
3265
        strlcpy(info->driver, VELOCITY_NAME, sizeof(info->driver));
 
3266
        strlcpy(info->version, VELOCITY_VERSION, sizeof(info->version));
 
3267
        strlcpy(info->bus_info, pci_name(vptr->pdev), sizeof(info->bus_info));
3273
3268
}
3274
3269
 
3275
3270
static void velocity_ethtool_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)