Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  wireless: remove duplicated .ndo_set_mac_address
  netfilter: xtables: fix IPv6 dependency in the cluster match
  tg3: Add GRO support.
  niu: Add GRO support.
  ucc_geth: Fix use-after-of_node_put() in ucc_geth_probe().
  gianfar: Fix use-after-of_node_put() in gfar_of_init().
  kernel: remove HIPQUAD()
  netpoll: store local and remote ip in net-endian
  netfilter: fix endian bug in conntrack printks
  dmascc: fix incomplete conversion to network_device_ops
  gso: Fix support for linear packets
  skbuff.h: fix missing kernel-doc
  ni5010: convert to net_device_ops
  • Loading branch information
torvalds committed Mar 31, 2009
2 parents d3d52d6 + 321dee6 commit 15f7176
Show file tree
Hide file tree
Showing 18 changed files with 68 additions and 70 deletions.
2 changes: 1 addition & 1 deletion drivers/net/gianfar.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -289,9 +289,9 @@ static int gfar_of_init(struct net_device *dev)
id = of_get_property(phy, "reg", NULL); id = of_get_property(phy, "reg", NULL);


of_node_put(phy); of_node_put(phy);
of_node_put(mdio);


fsl_pq_mdio_bus_name(bus_name, mdio); fsl_pq_mdio_bus_name(bus_name, mdio);
of_node_put(mdio);
snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x", snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x",
bus_name, *id); bus_name, *id);
} }
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/hamradio/dmascc.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ static const struct net_device_ops scc_netdev_ops = {
.ndo_stop = scc_close, .ndo_stop = scc_close,
.ndo_start_xmit = scc_send_packet, .ndo_start_xmit = scc_send_packet,
.ndo_do_ioctl = scc_ioctl, .ndo_do_ioctl = scc_ioctl,
.ndo_set_mac_address = scc_set_mac_address,
}; };


static int __init setup_adapter(int card_base, int type, int n) static int __init setup_adapter(int card_base, int type, int n)
Expand Down Expand Up @@ -584,7 +585,6 @@ static int __init setup_adapter(int card_base, int type, int n)
dev->irq = irq; dev->irq = irq;
dev->netdev_ops = &scc_netdev_ops; dev->netdev_ops = &scc_netdev_ops;
dev->header_ops = &ax25_header_ops; dev->header_ops = &ax25_header_ops;
dev->set_mac_address = scc_set_mac_address;
} }
if (register_netdev(info->dev[0])) { if (register_netdev(info->dev[0])) {
printk(KERN_ERR "dmascc: could not register %s\n", printk(KERN_ERR "dmascc: could not register %s\n",
Expand Down
10 changes: 4 additions & 6 deletions drivers/net/netconsole.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -294,14 +294,12 @@ static ssize_t show_remote_port(struct netconsole_target *nt, char *buf)


static ssize_t show_local_ip(struct netconsole_target *nt, char *buf) static ssize_t show_local_ip(struct netconsole_target *nt, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.local_ip);
HIPQUAD(nt->np.local_ip));
} }


static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf) static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
{ {
return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n", return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.remote_ip);
HIPQUAD(nt->np.remote_ip));
} }


static ssize_t show_local_mac(struct netconsole_target *nt, char *buf) static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
Expand Down Expand Up @@ -438,7 +436,7 @@ static ssize_t store_local_ip(struct netconsole_target *nt,
return -EINVAL; return -EINVAL;
} }


nt->np.local_ip = ntohl(in_aton(buf)); nt->np.local_ip = in_aton(buf);


return strnlen(buf, count); return strnlen(buf, count);
} }
Expand All @@ -454,7 +452,7 @@ static ssize_t store_remote_ip(struct netconsole_target *nt,
return -EINVAL; return -EINVAL;
} }


nt->np.remote_ip = ntohl(in_aton(buf)); nt->np.remote_ip = in_aton(buf);


return strnlen(buf, count); return strnlen(buf, count);
} }
Expand Down
18 changes: 12 additions & 6 deletions drivers/net/ni5010.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -189,6 +189,17 @@ static void __init trigger_irq(int ioaddr)
outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */ outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */
} }


static const struct net_device_ops ni5010_netdev_ops = {
.ndo_open = ni5010_open,
.ndo_stop = ni5010_close,
.ndo_start_xmit = ni5010_send_packet,
.ndo_set_multicast_list = ni5010_set_multicast_list,
.ndo_tx_timeout = ni5010_timeout,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_change_mtu = eth_change_mtu,
};

/* /*
* This is the real probe routine. Linux has a history of friendly device * This is the real probe routine. Linux has a history of friendly device
* probes on the ISA bus. A good device probes avoids doing writes, and * probes on the ISA bus. A good device probes avoids doing writes, and
Expand Down Expand Up @@ -328,13 +339,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */ outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */
} }
printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE); printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
memset(netdev_priv(dev), 0, sizeof(struct ni5010_local));


dev->open = ni5010_open; dev->netdev_ops = &ni5010_netdev_ops;
dev->stop = ni5010_close;
dev->hard_start_xmit = ni5010_send_packet;
dev->set_multicast_list = ni5010_set_multicast_list;
dev->tx_timeout = ni5010_timeout;
dev->watchdog_timeo = HZ/20; dev->watchdog_timeo = HZ/20;


dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */ dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */
Expand Down
12 changes: 7 additions & 5 deletions drivers/net/niu.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3441,7 +3441,8 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
return num_rcr; return num_rcr;
} }


static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp) static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
struct rx_ring_info *rp)
{ {
unsigned int index = rp->rcr_index; unsigned int index = rp->rcr_index;
struct sk_buff *skb; struct sk_buff *skb;
Expand Down Expand Up @@ -3518,7 +3519,7 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)


skb->protocol = eth_type_trans(skb, np->dev); skb->protocol = eth_type_trans(skb, np->dev);
skb_record_rx_queue(skb, rp->rx_channel); skb_record_rx_queue(skb, rp->rx_channel);
netif_receive_skb(skb); napi_gro_receive(napi, skb);


return num_rcr; return num_rcr;
} }
Expand Down Expand Up @@ -3706,7 +3707,8 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
} }
} }


static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget) static int niu_rx_work(struct napi_struct *napi, struct niu *np,
struct rx_ring_info *rp, int budget)
{ {
int qlen, rcr_done = 0, work_done = 0; int qlen, rcr_done = 0, work_done = 0;
struct rxdma_mailbox *mbox = rp->mbox; struct rxdma_mailbox *mbox = rp->mbox;
Expand All @@ -3728,7 +3730,7 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget)
rcr_done = work_done = 0; rcr_done = work_done = 0;
qlen = min(qlen, budget); qlen = min(qlen, budget);
while (work_done < qlen) { while (work_done < qlen) {
rcr_done += niu_process_rx_pkt(np, rp); rcr_done += niu_process_rx_pkt(napi, np, rp);
work_done++; work_done++;
} }


Expand Down Expand Up @@ -3776,7 +3778,7 @@ static int niu_poll_core(struct niu *np, struct niu_ldg *lp, int budget)
if (rx_vec & (1 << rp->rx_channel)) { if (rx_vec & (1 << rp->rx_channel)) {
int this_work_done; int this_work_done;


this_work_done = niu_rx_work(np, rp, this_work_done = niu_rx_work(&lp->napi, np, rp,
budget); budget);


budget -= this_work_done; budget -= this_work_done;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/tg3.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -4392,7 +4392,7 @@ static void tg3_recycle_rx(struct tg3 *tp, u32 opaque_key,
#if TG3_VLAN_TAG_USED #if TG3_VLAN_TAG_USED
static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag) static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag)
{ {
return vlan_hwaccel_receive_skb(skb, tp->vlgrp, vlan_tag); return vlan_gro_receive(&tp->napi, tp->vlgrp, vlan_tag, skb);
} }
#endif #endif


Expand Down Expand Up @@ -4539,7 +4539,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
desc->err_vlan & RXD_VLAN_MASK); desc->err_vlan & RXD_VLAN_MASK);
} else } else
#endif #endif
netif_receive_skb(skb); napi_gro_receive(&tp->napi, skb);


received++; received++;
budget--; budget--;
Expand Down
11 changes: 6 additions & 5 deletions drivers/net/ucc_geth.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3648,15 +3648,16 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
mdio = of_get_parent(phy); mdio = of_get_parent(phy);


if (mdio == NULL) if (mdio == NULL)
return -1; return -ENODEV;


err = of_address_to_resource(mdio, 0, &res); err = of_address_to_resource(mdio, 0, &res);
of_node_put(mdio);

if (err)
return -1;


if (err) {
of_node_put(mdio);
return err;
}
fsl_pq_mdio_bus_name(bus_name, mdio); fsl_pq_mdio_bus_name(bus_name, mdio);
of_node_put(mdio);
snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id), snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
"%s:%02x", bus_name, *prop); "%s:%02x", bus_name, *prop);
} }
Expand Down
2 changes: 0 additions & 2 deletions drivers/net/wireless/airo.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2752,7 +2752,6 @@ static const struct net_device_ops airo_netdev_ops = {
.ndo_set_mac_address = airo_set_mac_address, .ndo_set_mac_address = airo_set_mac_address,
.ndo_do_ioctl = airo_ioctl, .ndo_do_ioctl = airo_ioctl,
.ndo_change_mtu = airo_change_mtu, .ndo_change_mtu = airo_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };


Expand All @@ -2765,7 +2764,6 @@ static const struct net_device_ops mpi_netdev_ops = {
.ndo_set_mac_address = airo_set_mac_address, .ndo_set_mac_address = airo_set_mac_address,
.ndo_do_ioctl = airo_ioctl, .ndo_do_ioctl = airo_ioctl,
.ndo_change_mtu = airo_change_mtu, .ndo_change_mtu = airo_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };


Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/ipw2x00/ipw2200.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -11593,7 +11593,6 @@ static const struct net_device_ops ipw_netdev_ops = {
.ndo_set_mac_address = ipw_net_set_mac_address, .ndo_set_mac_address = ipw_net_set_mac_address,
.ndo_start_xmit = ieee80211_xmit, .ndo_start_xmit = ieee80211_xmit,
.ndo_change_mtu = ieee80211_change_mtu, .ndo_change_mtu = ieee80211_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };


Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/prism54/islpci_dev.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@ static const struct net_device_ops islpci_netdev_ops = {
.ndo_tx_timeout = islpci_eth_tx_timeout, .ndo_tx_timeout = islpci_eth_tx_timeout,
.ndo_set_mac_address = prism54_set_mac_address, .ndo_set_mac_address = prism54_set_mac_address,
.ndo_change_mtu = eth_change_mtu, .ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };


Expand Down
1 change: 0 additions & 1 deletion drivers/net/wireless/zd1201.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1725,7 +1725,6 @@ static const struct net_device_ops zd1201_netdev_ops = {
.ndo_set_multicast_list = zd1201_set_multicast, .ndo_set_multicast_list = zd1201_set_multicast,
.ndo_set_mac_address = zd1201_set_mac_address, .ndo_set_mac_address = zd1201_set_mac_address,
.ndo_change_mtu = eth_change_mtu, .ndo_change_mtu = eth_change_mtu,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
}; };


Expand Down
12 changes: 0 additions & 12 deletions include/linux/kernel.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -379,18 +379,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
((unsigned char *)&addr)[3] ((unsigned char *)&addr)[3]
#define NIPQUAD_FMT "%u.%u.%u.%u" #define NIPQUAD_FMT "%u.%u.%u.%u"


#if defined(__LITTLE_ENDIAN)
#define HIPQUAD(addr) \
((unsigned char *)&addr)[3], \
((unsigned char *)&addr)[2], \
((unsigned char *)&addr)[1], \
((unsigned char *)&addr)[0]
#elif defined(__BIG_ENDIAN)
#define HIPQUAD NIPQUAD
#else
#error "Please fix asm/byteorder.h"
#endif /* __LITTLE_ENDIAN */

/* /*
* min()/max()/clamp() macros that also do * min()/max()/clamp() macros that also do
* strict type-checking.. See the * strict type-checking.. See the
Expand Down
2 changes: 1 addition & 1 deletion include/linux/netpoll.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct netpoll {
const char *name; const char *name;
void (*rx_hook)(struct netpoll *, int, char *, int); void (*rx_hook)(struct netpoll *, int, char *, int);


u32 local_ip, remote_ip; __be32 local_ip, remote_ip;
u16 local_port, remote_port; u16 local_port, remote_port;
u8 remote_mac[ETH_ALEN]; u8 remote_mac[ETH_ALEN];
}; };
Expand Down
1 change: 1 addition & 0 deletions include/linux/skbuff.h
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ struct skb_shared_hwtstamps {
* @software: generate software time stamp * @software: generate software time stamp
* @in_progress: device driver is going to provide * @in_progress: device driver is going to provide
* hardware time stamp * hardware time stamp
* @flags: all shared_tx flags
* *
* These flags are attached to packets as part of the * These flags are attached to packets as part of the
* &skb_shared_info. Use skb_tx() to get a pointer. * &skb_shared_info. Use skb_tx() to get a pointer.
Expand Down
31 changes: 15 additions & 16 deletions net/core/netpoll.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
udph->dest = htons(np->remote_port); udph->dest = htons(np->remote_port);
udph->len = htons(udp_len); udph->len = htons(udp_len);
udph->check = 0; udph->check = 0;
udph->check = csum_tcpudp_magic(htonl(np->local_ip), udph->check = csum_tcpudp_magic(np->local_ip,
htonl(np->remote_ip), np->remote_ip,
udp_len, IPPROTO_UDP, udp_len, IPPROTO_UDP,
csum_partial(udph, udp_len, 0)); csum_partial(udph, udp_len, 0));
if (udph->check == 0) if (udph->check == 0)
Expand All @@ -365,8 +365,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
iph->ttl = 64; iph->ttl = 64;
iph->protocol = IPPROTO_UDP; iph->protocol = IPPROTO_UDP;
iph->check = 0; iph->check = 0;
put_unaligned(htonl(np->local_ip), &(iph->saddr)); put_unaligned(np->local_ip, &(iph->saddr));
put_unaligned(htonl(np->remote_ip), &(iph->daddr)); put_unaligned(np->remote_ip, &(iph->daddr));
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl); iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);


eth = (struct ethhdr *) skb_push(skb, ETH_HLEN); eth = (struct ethhdr *) skb_push(skb, ETH_HLEN);
Expand Down Expand Up @@ -424,7 +424,7 @@ static void arp_reply(struct sk_buff *skb)
memcpy(&tip, arp_ptr, 4); memcpy(&tip, arp_ptr, 4);


/* Should we ignore arp? */ /* Should we ignore arp? */
if (tip != htonl(np->local_ip) || if (tip != np->local_ip ||
ipv4_is_loopback(tip) || ipv4_is_multicast(tip)) ipv4_is_loopback(tip) || ipv4_is_multicast(tip))
return; return;


Expand Down Expand Up @@ -533,9 +533,9 @@ int __netpoll_rx(struct sk_buff *skb)
goto out; goto out;
if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr)) if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr))
goto out; goto out;
if (np->local_ip && np->local_ip != ntohl(iph->daddr)) if (np->local_ip && np->local_ip != iph->daddr)
goto out; goto out;
if (np->remote_ip && np->remote_ip != ntohl(iph->saddr)) if (np->remote_ip && np->remote_ip != iph->saddr)
goto out; goto out;
if (np->local_port && np->local_port != ntohs(uh->dest)) if (np->local_port && np->local_port != ntohs(uh->dest))
goto out; goto out;
Expand All @@ -560,14 +560,14 @@ void netpoll_print_options(struct netpoll *np)
{ {
printk(KERN_INFO "%s: local port %d\n", printk(KERN_INFO "%s: local port %d\n",
np->name, np->local_port); np->name, np->local_port);
printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", printk(KERN_INFO "%s: local IP %pI4\n",
np->name, HIPQUAD(np->local_ip)); np->name, &np->local_ip);
printk(KERN_INFO "%s: interface %s\n", printk(KERN_INFO "%s: interface %s\n",
np->name, np->dev_name); np->name, np->dev_name);
printk(KERN_INFO "%s: remote port %d\n", printk(KERN_INFO "%s: remote port %d\n",
np->name, np->remote_port); np->name, np->remote_port);
printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n", printk(KERN_INFO "%s: remote IP %pI4\n",
np->name, HIPQUAD(np->remote_ip)); np->name, &np->remote_ip);
printk(KERN_INFO "%s: remote ethernet address %pM\n", printk(KERN_INFO "%s: remote ethernet address %pM\n",
np->name, np->remote_mac); np->name, np->remote_mac);
} }
Expand All @@ -589,7 +589,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, '/')) == NULL) if ((delim = strchr(cur, '/')) == NULL)
goto parse_failed; goto parse_failed;
*delim = 0; *delim = 0;
np->local_ip = ntohl(in_aton(cur)); np->local_ip = in_aton(cur);
cur = delim; cur = delim;
} }
cur++; cur++;
Expand Down Expand Up @@ -618,7 +618,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
if ((delim = strchr(cur, '/')) == NULL) if ((delim = strchr(cur, '/')) == NULL)
goto parse_failed; goto parse_failed;
*delim = 0; *delim = 0;
np->remote_ip = ntohl(in_aton(cur)); np->remote_ip = in_aton(cur);
cur = delim + 1; cur = delim + 1;


if (*cur != 0) { if (*cur != 0) {
Expand Down Expand Up @@ -759,10 +759,9 @@ int netpoll_setup(struct netpoll *np)
goto release; goto release;
} }


np->local_ip = ntohl(in_dev->ifa_list->ifa_local); np->local_ip = in_dev->ifa_list->ifa_local;
rcu_read_unlock(); rcu_read_unlock();
printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n", printk(KERN_INFO "%s: local IP %pI4\n", np->name, &np->local_ip);
np->name, HIPQUAD(np->local_ip));
} }


if (np->rx_hook) { if (np->rx_hook) {
Expand Down
2 changes: 1 addition & 1 deletion net/core/skbuff.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2579,7 +2579,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
skb_network_header_len(skb)); skb_network_header_len(skb));
skb_copy_from_linear_data(skb, nskb->data, doffset); skb_copy_from_linear_data(skb, nskb->data, doffset);


if (pos >= offset + len) if (fskb != skb_shinfo(skb)->frag_list)
continue; continue;


if (!sg) { if (!sg) {
Expand Down
Loading

0 comments on commit 15f7176

Please sign in to comment.