Skip to content

Commit 15f7176

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
* 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
2 parents d3d52d6 + 321dee6 commit 15f7176

File tree

18 files changed

+68
-70
lines changed

18 files changed

+68
-70
lines changed

drivers/net/gianfar.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ static int gfar_of_init(struct net_device *dev)
289289
id = of_get_property(phy, "reg", NULL);
290290

291291
of_node_put(phy);
292-
of_node_put(mdio);
293292

294293
fsl_pq_mdio_bus_name(bus_name, mdio);
294+
of_node_put(mdio);
295295
snprintf(priv->phy_bus_id, sizeof(priv->phy_bus_id), "%s:%02x",
296296
bus_name, *id);
297297
}

drivers/net/hamradio/dmascc.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,6 +445,7 @@ static const struct net_device_ops scc_netdev_ops = {
445445
.ndo_stop = scc_close,
446446
.ndo_start_xmit = scc_send_packet,
447447
.ndo_do_ioctl = scc_ioctl,
448+
.ndo_set_mac_address = scc_set_mac_address,
448449
};
449450

450451
static int __init setup_adapter(int card_base, int type, int n)
@@ -584,7 +585,6 @@ static int __init setup_adapter(int card_base, int type, int n)
584585
dev->irq = irq;
585586
dev->netdev_ops = &scc_netdev_ops;
586587
dev->header_ops = &ax25_header_ops;
587-
dev->set_mac_address = scc_set_mac_address;
588588
}
589589
if (register_netdev(info->dev[0])) {
590590
printk(KERN_ERR "dmascc: could not register %s\n",

drivers/net/netconsole.c

+4-6
Original file line numberDiff line numberDiff line change
@@ -294,14 +294,12 @@ static ssize_t show_remote_port(struct netconsole_target *nt, char *buf)
294294

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

301300
static ssize_t show_remote_ip(struct netconsole_target *nt, char *buf)
302301
{
303-
return snprintf(buf, PAGE_SIZE, "%d.%d.%d.%d\n",
304-
HIPQUAD(nt->np.remote_ip));
302+
return snprintf(buf, PAGE_SIZE, "%pI4\n", &nt->np.remote_ip);
305303
}
306304

307305
static ssize_t show_local_mac(struct netconsole_target *nt, char *buf)
@@ -438,7 +436,7 @@ static ssize_t store_local_ip(struct netconsole_target *nt,
438436
return -EINVAL;
439437
}
440438

441-
nt->np.local_ip = ntohl(in_aton(buf));
439+
nt->np.local_ip = in_aton(buf);
442440

443441
return strnlen(buf, count);
444442
}
@@ -454,7 +452,7 @@ static ssize_t store_remote_ip(struct netconsole_target *nt,
454452
return -EINVAL;
455453
}
456454

457-
nt->np.remote_ip = ntohl(in_aton(buf));
455+
nt->np.remote_ip = in_aton(buf);
458456

459457
return strnlen(buf, count);
460458
}

drivers/net/ni5010.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ static void __init trigger_irq(int ioaddr)
189189
outb(MM_EN_XMT|MM_MUX, IE_MMODE); /* Start transmission */
190190
}
191191

192+
static const struct net_device_ops ni5010_netdev_ops = {
193+
.ndo_open = ni5010_open,
194+
.ndo_stop = ni5010_close,
195+
.ndo_start_xmit = ni5010_send_packet,
196+
.ndo_set_multicast_list = ni5010_set_multicast_list,
197+
.ndo_tx_timeout = ni5010_timeout,
198+
.ndo_validate_addr = eth_validate_addr,
199+
.ndo_set_mac_address = eth_mac_addr,
200+
.ndo_change_mtu = eth_change_mtu,
201+
};
202+
192203
/*
193204
* This is the real probe routine. Linux has a history of friendly device
194205
* probes on the ISA bus. A good device probes avoids doing writes, and
@@ -328,13 +339,8 @@ static int __init ni5010_probe1(struct net_device *dev, int ioaddr)
328339
outb(0, IE_RBUF); /* set buffer byte 0 to 0 again */
329340
}
330341
printk("-> bufsize rcv/xmt=%d/%d\n", bufsize_rcv, NI5010_BUFSIZE);
331-
memset(netdev_priv(dev), 0, sizeof(struct ni5010_local));
332342

333-
dev->open = ni5010_open;
334-
dev->stop = ni5010_close;
335-
dev->hard_start_xmit = ni5010_send_packet;
336-
dev->set_multicast_list = ni5010_set_multicast_list;
337-
dev->tx_timeout = ni5010_timeout;
343+
dev->netdev_ops = &ni5010_netdev_ops;
338344
dev->watchdog_timeo = HZ/20;
339345

340346
dev->flags &= ~IFF_MULTICAST; /* Multicast doesn't work */

drivers/net/niu.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -3441,7 +3441,8 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
34413441
return num_rcr;
34423442
}
34433443

3444-
static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
3444+
static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
3445+
struct rx_ring_info *rp)
34453446
{
34463447
unsigned int index = rp->rcr_index;
34473448
struct sk_buff *skb;
@@ -3518,7 +3519,7 @@ static int niu_process_rx_pkt(struct niu *np, struct rx_ring_info *rp)
35183519

35193520
skb->protocol = eth_type_trans(skb, np->dev);
35203521
skb_record_rx_queue(skb, rp->rx_channel);
3521-
netif_receive_skb(skb);
3522+
napi_gro_receive(napi, skb);
35223523

35233524
return num_rcr;
35243525
}
@@ -3706,7 +3707,8 @@ static inline void niu_sync_rx_discard_stats(struct niu *np,
37063707
}
37073708
}
37083709

3709-
static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget)
3710+
static int niu_rx_work(struct napi_struct *napi, struct niu *np,
3711+
struct rx_ring_info *rp, int budget)
37103712
{
37113713
int qlen, rcr_done = 0, work_done = 0;
37123714
struct rxdma_mailbox *mbox = rp->mbox;
@@ -3728,7 +3730,7 @@ static int niu_rx_work(struct niu *np, struct rx_ring_info *rp, int budget)
37283730
rcr_done = work_done = 0;
37293731
qlen = min(qlen, budget);
37303732
while (work_done < qlen) {
3731-
rcr_done += niu_process_rx_pkt(np, rp);
3733+
rcr_done += niu_process_rx_pkt(napi, np, rp);
37323734
work_done++;
37333735
}
37343736

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

3779-
this_work_done = niu_rx_work(np, rp,
3781+
this_work_done = niu_rx_work(&lp->napi, np, rp,
37803782
budget);
37813783

37823784
budget -= this_work_done;

drivers/net/tg3.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -4392,7 +4392,7 @@ static void tg3_recycle_rx(struct tg3 *tp, u32 opaque_key,
43924392
#if TG3_VLAN_TAG_USED
43934393
static int tg3_vlan_rx(struct tg3 *tp, struct sk_buff *skb, u16 vlan_tag)
43944394
{
4395-
return vlan_hwaccel_receive_skb(skb, tp->vlgrp, vlan_tag);
4395+
return vlan_gro_receive(&tp->napi, tp->vlgrp, vlan_tag, skb);
43964396
}
43974397
#endif
43984398

@@ -4539,7 +4539,7 @@ static int tg3_rx(struct tg3 *tp, int budget)
45394539
desc->err_vlan & RXD_VLAN_MASK);
45404540
} else
45414541
#endif
4542-
netif_receive_skb(skb);
4542+
napi_gro_receive(&tp->napi, skb);
45434543

45444544
received++;
45454545
budget--;

drivers/net/ucc_geth.c

+6-5
Original file line numberDiff line numberDiff line change
@@ -3648,15 +3648,16 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
36483648
mdio = of_get_parent(phy);
36493649

36503650
if (mdio == NULL)
3651-
return -1;
3651+
return -ENODEV;
36523652

36533653
err = of_address_to_resource(mdio, 0, &res);
3654-
of_node_put(mdio);
3655-
3656-
if (err)
3657-
return -1;
36583654

3655+
if (err) {
3656+
of_node_put(mdio);
3657+
return err;
3658+
}
36593659
fsl_pq_mdio_bus_name(bus_name, mdio);
3660+
of_node_put(mdio);
36603661
snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
36613662
"%s:%02x", bus_name, *prop);
36623663
}

drivers/net/wireless/airo.c

-2
Original file line numberDiff line numberDiff line change
@@ -2752,7 +2752,6 @@ static const struct net_device_ops airo_netdev_ops = {
27522752
.ndo_set_mac_address = airo_set_mac_address,
27532753
.ndo_do_ioctl = airo_ioctl,
27542754
.ndo_change_mtu = airo_change_mtu,
2755-
.ndo_set_mac_address = eth_mac_addr,
27562755
.ndo_validate_addr = eth_validate_addr,
27572756
};
27582757

@@ -2765,7 +2764,6 @@ static const struct net_device_ops mpi_netdev_ops = {
27652764
.ndo_set_mac_address = airo_set_mac_address,
27662765
.ndo_do_ioctl = airo_ioctl,
27672766
.ndo_change_mtu = airo_change_mtu,
2768-
.ndo_set_mac_address = eth_mac_addr,
27692767
.ndo_validate_addr = eth_validate_addr,
27702768
};
27712769

drivers/net/wireless/ipw2x00/ipw2200.c

-1
Original file line numberDiff line numberDiff line change
@@ -11593,7 +11593,6 @@ static const struct net_device_ops ipw_netdev_ops = {
1159311593
.ndo_set_mac_address = ipw_net_set_mac_address,
1159411594
.ndo_start_xmit = ieee80211_xmit,
1159511595
.ndo_change_mtu = ieee80211_change_mtu,
11596-
.ndo_set_mac_address = eth_mac_addr,
1159711596
.ndo_validate_addr = eth_validate_addr,
1159811597
};
1159911598

drivers/net/wireless/prism54/islpci_dev.c

-1
Original file line numberDiff line numberDiff line change
@@ -803,7 +803,6 @@ static const struct net_device_ops islpci_netdev_ops = {
803803
.ndo_tx_timeout = islpci_eth_tx_timeout,
804804
.ndo_set_mac_address = prism54_set_mac_address,
805805
.ndo_change_mtu = eth_change_mtu,
806-
.ndo_set_mac_address = eth_mac_addr,
807806
.ndo_validate_addr = eth_validate_addr,
808807
};
809808

drivers/net/wireless/zd1201.c

-1
Original file line numberDiff line numberDiff line change
@@ -1725,7 +1725,6 @@ static const struct net_device_ops zd1201_netdev_ops = {
17251725
.ndo_set_multicast_list = zd1201_set_multicast,
17261726
.ndo_set_mac_address = zd1201_set_mac_address,
17271727
.ndo_change_mtu = eth_change_mtu,
1728-
.ndo_set_mac_address = eth_mac_addr,
17291728
.ndo_validate_addr = eth_validate_addr,
17301729
};
17311730

include/linux/kernel.h

-12
Original file line numberDiff line numberDiff line change
@@ -379,18 +379,6 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
379379
((unsigned char *)&addr)[3]
380380
#define NIPQUAD_FMT "%u.%u.%u.%u"
381381

382-
#if defined(__LITTLE_ENDIAN)
383-
#define HIPQUAD(addr) \
384-
((unsigned char *)&addr)[3], \
385-
((unsigned char *)&addr)[2], \
386-
((unsigned char *)&addr)[1], \
387-
((unsigned char *)&addr)[0]
388-
#elif defined(__BIG_ENDIAN)
389-
#define HIPQUAD NIPQUAD
390-
#else
391-
#error "Please fix asm/byteorder.h"
392-
#endif /* __LITTLE_ENDIAN */
393-
394382
/*
395383
* min()/max()/clamp() macros that also do
396384
* strict type-checking.. See the

include/linux/netpoll.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ struct netpoll {
1818
const char *name;
1919
void (*rx_hook)(struct netpoll *, int, char *, int);
2020

21-
u32 local_ip, remote_ip;
21+
__be32 local_ip, remote_ip;
2222
u16 local_port, remote_port;
2323
u8 remote_mac[ETH_ALEN];
2424
};

include/linux/skbuff.h

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ struct skb_shared_hwtstamps {
168168
* @software: generate software time stamp
169169
* @in_progress: device driver is going to provide
170170
* hardware time stamp
171+
* @flags: all shared_tx flags
171172
*
172173
* These flags are attached to packets as part of the
173174
* &skb_shared_info. Use skb_tx() to get a pointer.

net/core/netpoll.c

+15-16
Original file line numberDiff line numberDiff line change
@@ -345,8 +345,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
345345
udph->dest = htons(np->remote_port);
346346
udph->len = htons(udp_len);
347347
udph->check = 0;
348-
udph->check = csum_tcpudp_magic(htonl(np->local_ip),
349-
htonl(np->remote_ip),
348+
udph->check = csum_tcpudp_magic(np->local_ip,
349+
np->remote_ip,
350350
udp_len, IPPROTO_UDP,
351351
csum_partial(udph, udp_len, 0));
352352
if (udph->check == 0)
@@ -365,8 +365,8 @@ void netpoll_send_udp(struct netpoll *np, const char *msg, int len)
365365
iph->ttl = 64;
366366
iph->protocol = IPPROTO_UDP;
367367
iph->check = 0;
368-
put_unaligned(htonl(np->local_ip), &(iph->saddr));
369-
put_unaligned(htonl(np->remote_ip), &(iph->daddr));
368+
put_unaligned(np->local_ip, &(iph->saddr));
369+
put_unaligned(np->remote_ip, &(iph->daddr));
370370
iph->check = ip_fast_csum((unsigned char *)iph, iph->ihl);
371371

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

426426
/* Should we ignore arp? */
427-
if (tip != htonl(np->local_ip) ||
427+
if (tip != np->local_ip ||
428428
ipv4_is_loopback(tip) || ipv4_is_multicast(tip))
429429
return;
430430

@@ -533,9 +533,9 @@ int __netpoll_rx(struct sk_buff *skb)
533533
goto out;
534534
if (checksum_udp(skb, uh, ulen, iph->saddr, iph->daddr))
535535
goto out;
536-
if (np->local_ip && np->local_ip != ntohl(iph->daddr))
536+
if (np->local_ip && np->local_ip != iph->daddr)
537537
goto out;
538-
if (np->remote_ip && np->remote_ip != ntohl(iph->saddr))
538+
if (np->remote_ip && np->remote_ip != iph->saddr)
539539
goto out;
540540
if (np->local_port && np->local_port != ntohs(uh->dest))
541541
goto out;
@@ -560,14 +560,14 @@ void netpoll_print_options(struct netpoll *np)
560560
{
561561
printk(KERN_INFO "%s: local port %d\n",
562562
np->name, np->local_port);
563-
printk(KERN_INFO "%s: local IP %d.%d.%d.%d\n",
564-
np->name, HIPQUAD(np->local_ip));
563+
printk(KERN_INFO "%s: local IP %pI4\n",
564+
np->name, &np->local_ip);
565565
printk(KERN_INFO "%s: interface %s\n",
566566
np->name, np->dev_name);
567567
printk(KERN_INFO "%s: remote port %d\n",
568568
np->name, np->remote_port);
569-
printk(KERN_INFO "%s: remote IP %d.%d.%d.%d\n",
570-
np->name, HIPQUAD(np->remote_ip));
569+
printk(KERN_INFO "%s: remote IP %pI4\n",
570+
np->name, &np->remote_ip);
571571
printk(KERN_INFO "%s: remote ethernet address %pM\n",
572572
np->name, np->remote_mac);
573573
}
@@ -589,7 +589,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
589589
if ((delim = strchr(cur, '/')) == NULL)
590590
goto parse_failed;
591591
*delim = 0;
592-
np->local_ip = ntohl(in_aton(cur));
592+
np->local_ip = in_aton(cur);
593593
cur = delim;
594594
}
595595
cur++;
@@ -618,7 +618,7 @@ int netpoll_parse_options(struct netpoll *np, char *opt)
618618
if ((delim = strchr(cur, '/')) == NULL)
619619
goto parse_failed;
620620
*delim = 0;
621-
np->remote_ip = ntohl(in_aton(cur));
621+
np->remote_ip = in_aton(cur);
622622
cur = delim + 1;
623623

624624
if (*cur != 0) {
@@ -759,10 +759,9 @@ int netpoll_setup(struct netpoll *np)
759759
goto release;
760760
}
761761

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

768767
if (np->rx_hook) {

net/core/skbuff.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -2579,7 +2579,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
25792579
skb_network_header_len(skb));
25802580
skb_copy_from_linear_data(skb, nskb->data, doffset);
25812581

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

25852585
if (!sg) {

0 commit comments

Comments
 (0)