projects
/
deliverable
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
iwlwifi: update iwl-commands.h for 3 stream support
[deliverable/linux.git]
/
drivers
/
net
/
sungem.c
diff --git
a/drivers/net/sungem.c
b/drivers/net/sungem.c
index 68872142530b5e5a7807157c0b8e539494e62a1b..44be8dfbcf171b33d582aad8b2421c2ff9203c39 100644
(file)
--- a/
drivers/net/sungem.c
+++ b/
drivers/net/sungem.c
@@
-164,7
+164,7
@@
static u16 __phy_read(struct gem *gp, int phy_addr, int reg)
static inline int _phy_read(struct net_device *dev, int mii_id, int reg)
{
static inline int _phy_read(struct net_device *dev, int mii_id, int reg)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
return __phy_read(gp, mii_id, reg);
}
return __phy_read(gp, mii_id, reg);
}
@@
-197,7
+197,7
@@
static void __phy_write(struct gem *gp, int phy_addr, int reg, u16 val)
static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val)
{
static inline void _phy_write(struct net_device *dev, int mii_id, int reg, int val)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
__phy_write(gp, mii_id, reg, val & 0xffff);
}
__phy_write(gp, mii_id, reg, val & 0xffff);
}
@@
-758,6
+758,7
@@
static int gem_rx(struct gem *gp, int work_to_do)
{
int entry, drops, work_done = 0;
u32 done;
{
int entry, drops, work_done = 0;
u32 done;
+ __sum16 csum;
if (netif_msg_rx_status(gp))
printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
if (netif_msg_rx_status(gp))
printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
@@
-769,7
+770,7
@@
static int gem_rx(struct gem *gp, int work_to_do)
for (;;) {
struct gem_rxd *rxd = &gp->init_block->rxd[entry];
struct sk_buff *skb;
for (;;) {
struct gem_rxd *rxd = &gp->init_block->rxd[entry];
struct sk_buff *skb;
- u64 status =
cpu_to_le64
(rxd->status_word);
+ u64 status =
le64_to_cpu
(rxd->status_word);
dma_addr_t dma_addr;
int len;
dma_addr_t dma_addr;
int len;
@@
-811,7
+812,7
@@
static int gem_rx(struct gem *gp, int work_to_do)
goto next;
}
goto next;
}
- dma_addr =
cpu_to_le64
(rxd->buffer);
+ dma_addr =
le64_to_cpu
(rxd->buffer);
if (len > RX_COPY_THRESHOLD) {
struct sk_buff *new_skb;
if (len > RX_COPY_THRESHOLD) {
struct sk_buff *new_skb;
@@
-853,7
+854,8
@@
static int gem_rx(struct gem *gp, int work_to_do)
skb = copy_skb;
}
skb = copy_skb;
}
- skb->csum = ntohs((status & RXDCTRL_TCPCSUM) ^ 0xffff);
+ csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
+ skb->csum = csum_unfold(csum);
skb->ip_summed = CHECKSUM_COMPLETE;
skb->protocol = eth_type_trans(skb, gp->dev);
skb->ip_summed = CHECKSUM_COMPLETE;
skb->protocol = eth_type_trans(skb, gp->dev);
@@
-861,7
+863,6
@@
static int gem_rx(struct gem *gp, int work_to_do)
gp->net_stats.rx_packets++;
gp->net_stats.rx_bytes += len;
gp->net_stats.rx_packets++;
gp->net_stats.rx_bytes += len;
- gp->dev->last_rx = jiffies;
next:
entry = NEXT_RX(entry);
next:
entry = NEXT_RX(entry);
@@
-910,7
+911,7
@@
static int gem_poll(struct napi_struct *napi, int budget)
* rx ring - must call napi_disable(), which
* schedule_timeout()'s if polling is already disabled.
*/
* rx ring - must call napi_disable(), which
* schedule_timeout()'s if polling is already disabled.
*/
- work_done += gem_rx(gp, budget);
+ work_done += gem_rx(gp, budget
- work_done
);
if (work_done >= budget)
return work_done;
if (work_done >= budget)
return work_done;
@@
-931,7
+932,7
@@
static int gem_poll(struct napi_struct *napi, int budget)
static irqreturn_t gem_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
static irqreturn_t gem_interrupt(int irq, void *dev_id)
{
struct net_device *dev = dev_id;
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned long flags;
/* Swallow interrupts when shutting the chip down, though
unsigned long flags;
/* Swallow interrupts when shutting the chip down, though
@@
-977,7
+978,7
@@
static void gem_poll_controller(struct net_device *dev)
static void gem_tx_timeout(struct net_device *dev)
{
static void gem_tx_timeout(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
if (!gp->running) {
printk(KERN_ERR "%s: transmit timed out, resetting\n", dev->name);
if (!gp->running) {
@@
-1016,7
+1017,7
@@
static __inline__ int gem_intme(int entry)
static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
static int gem_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
int entry;
u64 ctrl;
unsigned long flags;
int entry;
u64 ctrl;
unsigned long flags;
@@
-2189,7
+2190,7
@@
static void gem_stop_phy(struct gem *gp, int wol)
static int gem_do_start(struct net_device *dev)
{
static int gem_do_start(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned long flags;
spin_lock_irqsave(&gp->lock, flags);
unsigned long flags;
spin_lock_irqsave(&gp->lock, flags);
@@
-2236,7
+2237,7
@@
static int gem_do_start(struct net_device *dev)
static void gem_do_stop(struct net_device *dev, int wol)
{
static void gem_do_stop(struct net_device *dev, int wol)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned long flags;
spin_lock_irqsave(&gp->lock, flags);
unsigned long flags;
spin_lock_irqsave(&gp->lock, flags);
@@
-2311,7
+2312,7
@@
static void gem_reset_task(struct work_struct *work)
static int gem_open(struct net_device *dev)
{
static int gem_open(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
int rc = 0;
mutex_lock(&gp->pm_mutex);
int rc = 0;
mutex_lock(&gp->pm_mutex);
@@
-2330,7
+2331,7
@@
static int gem_open(struct net_device *dev)
static int gem_close(struct net_device *dev)
{
static int gem_close(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
mutex_lock(&gp->pm_mutex);
mutex_lock(&gp->pm_mutex);
@@
-2349,7
+2350,7
@@
static int gem_close(struct net_device *dev)
static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned long flags;
mutex_lock(&gp->pm_mutex);
unsigned long flags;
mutex_lock(&gp->pm_mutex);
@@
-2413,7
+2414,7
@@
static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
static int gem_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
static int gem_resume(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned long flags;
printk(KERN_INFO "%s: resuming\n", dev->name);
unsigned long flags;
printk(KERN_INFO "%s: resuming\n", dev->name);
@@
-2487,7
+2488,7
@@
static int gem_resume(struct pci_dev *pdev)
static struct net_device_stats *gem_get_stats(struct net_device *dev)
{
static struct net_device_stats *gem_get_stats(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
struct net_device_stats *stats = &gp->net_stats;
spin_lock_irq(&gp->lock);
struct net_device_stats *stats = &gp->net_stats;
spin_lock_irq(&gp->lock);
@@
-2523,7
+2524,7
@@
static struct net_device_stats *gem_get_stats(struct net_device *dev)
static int gem_set_mac_address(struct net_device *dev, void *addr)
{
struct sockaddr *macaddr = (struct sockaddr *) addr;
static int gem_set_mac_address(struct net_device *dev, void *addr)
{
struct sockaddr *macaddr = (struct sockaddr *) addr;
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unsigned char *e = &dev->dev_addr[0];
if (!is_valid_ether_addr(macaddr->sa_data))
unsigned char *e = &dev->dev_addr[0];
if (!is_valid_ether_addr(macaddr->sa_data))
@@
-2551,7
+2552,7
@@
static int gem_set_mac_address(struct net_device *dev, void *addr)
static void gem_set_multicast(struct net_device *dev)
{
static void gem_set_multicast(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
u32 rxcfg, rxcfg_new;
int limit = 10000;
u32 rxcfg, rxcfg_new;
int limit = 10000;
@@
-2600,7
+2601,7
@@
static void gem_set_multicast(struct net_device *dev)
static int gem_change_mtu(struct net_device *dev, int new_mtu)
{
static int gem_change_mtu(struct net_device *dev, int new_mtu)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU)
return -EINVAL;
if (new_mtu < GEM_MIN_MTU || new_mtu > GEM_MAX_MTU)
return -EINVAL;
@@
-2631,7
+2632,7
@@
static int gem_change_mtu(struct net_device *dev, int new_mtu)
static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION);
strcpy(info->driver, DRV_NAME);
strcpy(info->version, DRV_VERSION);
@@
-2640,7
+2641,7
@@
static void gem_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1) {
if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1) {
@@
-2686,7
+2687,7
@@
static int gem_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
/* Verify the settings we care about. */
if (cmd->autoneg != AUTONEG_ENABLE &&
/* Verify the settings we care about. */
if (cmd->autoneg != AUTONEG_ENABLE &&
@@
-2717,7
+2718,7
@@
static int gem_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
static int gem_nway_reset(struct net_device *dev)
{
static int gem_nway_reset(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
if (!gp->want_autoneg)
return -EINVAL;
if (!gp->want_autoneg)
return -EINVAL;
@@
-2734,13
+2735,13
@@
static int gem_nway_reset(struct net_device *dev)
static u32 gem_get_msglevel(struct net_device *dev)
{
static u32 gem_get_msglevel(struct net_device *dev)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
return gp->msg_enable;
}
static void gem_set_msglevel(struct net_device *dev, u32 value)
{
return gp->msg_enable;
}
static void gem_set_msglevel(struct net_device *dev, u32 value)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
gp->msg_enable = value;
}
gp->msg_enable = value;
}
@@
-2752,7
+2753,7
@@
static void gem_set_msglevel(struct net_device *dev, u32 value)
static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
/* Add more when I understand how to program the chip */
if (gp->has_wol) {
/* Add more when I understand how to program the chip */
if (gp->has_wol) {
@@
-2766,7
+2767,7
@@
static void gem_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
static int gem_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
if (!gp->has_wol)
return -EOPNOTSUPP;
if (!gp->has_wol)
return -EOPNOTSUPP;
@@
-2788,7
+2789,7
@@
static const struct ethtool_ops gem_ethtool_ops = {
static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
static int gem_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
struct mii_ioctl_data *data = if_mii(ifr);
int rc = -EOPNOTSUPP;
unsigned long flags;
struct mii_ioctl_data *data = if_mii(ifr);
int rc = -EOPNOTSUPP;
unsigned long flags;
@@
-2920,7
+2921,7
@@
static void gem_remove_one(struct pci_dev *pdev)
struct net_device *dev = pci_get_drvdata(pdev);
if (dev) {
struct net_device *dev = pci_get_drvdata(pdev);
if (dev) {
- struct gem *gp =
dev->priv
;
+ struct gem *gp =
netdev_priv(dev)
;
unregister_netdev(dev);
unregister_netdev(dev);
@@
-2964,7
+2965,6
@@
static int __devinit gem_init_one(struct pci_dev *pdev,
struct net_device *dev;
struct gem *gp;
int err, pci_using_dac;
struct net_device *dev;
struct gem *gp;
int err, pci_using_dac;
- DECLARE_MAC_BUF(mac);
if (gem_version_printed++ == 0)
printk(KERN_INFO "%s", version);
if (gem_version_printed++ == 0)
printk(KERN_INFO "%s", version);
@@
-3024,7
+3024,7
@@
static int __devinit gem_init_one(struct pci_dev *pdev,
}
SET_NETDEV_DEV(dev, &pdev->dev);
}
SET_NETDEV_DEV(dev, &pdev->dev);
- gp =
dev->priv
;
+ gp =
netdev_priv(dev)
;
err = pci_request_regions(pdev, DRV_NAME);
if (err) {
err = pci_request_regions(pdev, DRV_NAME);
if (err) {
@@
-3054,7
+3054,7
@@
static int __devinit gem_init_one(struct pci_dev *pdev,
netif_carrier_off(dev);
gp->regs = ioremap(gemreg_base, gemreg_len);
netif_carrier_off(dev);
gp->regs = ioremap(gemreg_base, gemreg_len);
- if (
gp->regs == 0UL
) {
+ if (
!gp->regs
) {
printk(KERN_ERR PFX "Cannot map device registers, "
"aborting.\n");
err = -EIO;
printk(KERN_ERR PFX "Cannot map device registers, "
"aborting.\n");
err = -EIO;
@@
-3148,9
+3148,8
@@
static int __devinit gem_init_one(struct pci_dev *pdev,
goto err_out_free_consistent;
}
goto err_out_free_consistent;
}
- printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet "
- "%s\n",
- dev->name, print_mac(mac, dev->dev_addr));
+ printk(KERN_INFO "%s: Sun GEM (PCI) 10/100/1000BaseT Ethernet %pM\n",
+ dev->name, dev->dev_addr);
if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1)
if (gp->phy_type == phy_mii_mdio0 ||
gp->phy_type == phy_mii_mdio1)
This page took
0.029355 seconds
and
5
git commands to generate.