Skip to content

Commit

Permalink
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/…
Browse files Browse the repository at this point in the history
…davem/net-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (41 commits)
  [RTNETLINK]: Fix warning for !CONFIG_KMOD
  [IPV4] ip_options.c: kmalloc + memset conversion to kzalloc
  [DECNET]: kmalloc + memset conversion to kzalloc
  [NET]: ethtool_perm_addr only has one implementation
  [NET]: ethtool ops are the only way
  [PPPOE]: Improve hashing function in hash_item().
  [XFRM]: State selection update to use inner addresses.
  [IPSEC]: Ensure that state inner family is set
  [TCP]: Bidir flow must not disregard SACK blocks for lost marking
  [TCP]: Fix ratehalving with bidirectional flows
  [PPPOL2TP]: Add CONFIG_INET Kconfig dependency.
  [NET]: Page offsets and lengths need to be __u32.
  [AF_UNIX]: Make code static.
  [NETFILTER]: Make nf_ct_ipv6_skip_exthdr() static.
  [PKTGEN]: make get_ipsec_sa() static and non-inline
  [PPPoE]: move lock_sock() in pppoe_sendmsg() to the right location
  [PPPoX/E]: return ENOTTY on unknown ioctl requests
  [IPV6]: ipv6_addr_type() doesn't know about RFC4193 addresses.
  [NET]: Fix prio_tune() handling of root qdisc.
  [NET]: Fix sch_api to properly set sch->parent on the root.
  ...
  • Loading branch information
Linus Torvalds committed Jul 31, 2007
2 parents 88c8199 + 8072f08 commit 0d6caa1
Show file tree
Hide file tree
Showing 74 changed files with 451 additions and 471 deletions.
27 changes: 0 additions & 27 deletions drivers/dma/iovlock.c
Original file line number Diff line number Diff line change
Expand Up @@ -143,29 +143,6 @@ void dma_unpin_iovec_pages(struct dma_pinned_list *pinned_list)
kfree(pinned_list);
}

static dma_cookie_t dma_memcpy_to_kernel_iovec(struct dma_chan *chan, struct
iovec *iov, unsigned char *kdata, size_t len)
{
dma_cookie_t dma_cookie = 0;

while (len > 0) {
if (iov->iov_len) {
int copy = min_t(unsigned int, iov->iov_len, len);
dma_cookie = dma_async_memcpy_buf_to_buf(
chan,
iov->iov_base,
kdata,
copy);
kdata += copy;
len -= copy;
iov->iov_len -= copy;
iov->iov_base += copy;
}
iov++;
}

return dma_cookie;
}

/*
* We have already pinned down the pages we will be using in the iovecs.
Expand All @@ -187,10 +164,6 @@ dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
if (!chan)
return memcpy_toiovec(iov, kdata, len);

/* -> kernel copies (e.g. smbfs) */
if (!pinned_list)
return dma_memcpy_to_kernel_iovec(chan, iov, kdata, len);

iovec_idx = 0;
while (iovec_idx < pinned_list->nr_iovecs) {
struct dma_page_list *page_list;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -2886,7 +2886,6 @@ static const struct ethtool_ops vortex_ethtool_ops = {
.set_settings = vortex_set_settings,
.get_link = ethtool_op_get_link,
.nway_reset = vortex_nway_reset,
.get_perm_addr = ethtool_op_get_perm_addr,
};

#ifdef CONFIG_PCI
Expand Down
1 change: 0 additions & 1 deletion drivers/net/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,6 @@ static const struct ethtool_ops cp_ethtool_ops = {
.set_wol = cp_set_wol,
.get_strings = cp_get_strings,
.get_ethtool_stats = cp_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
.get_eeprom_len = cp_get_eeprom_len,
.get_eeprom = cp_get_eeprom,
.set_eeprom = cp_set_eeprom,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/8139too.c
Original file line number Diff line number Diff line change
Expand Up @@ -2452,7 +2452,6 @@ static const struct ethtool_ops rtl8139_ethtool_ops = {
.get_strings = rtl8139_get_strings,
.get_stats_count = rtl8139_get_stats_count,
.get_ethtool_stats = rtl8139_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2851,7 +2851,7 @@ config PPPOATM

config PPPOL2TP
tristate "PPP over L2TP (EXPERIMENTAL)"
depends on EXPERIMENTAL && PPP
depends on EXPERIMENTAL && PPP && INET
help
Support for PPP-over-L2TP socket family. L2TP is a protocol
used by ISPs and enterprises to tunnel PPP traffic over UDP
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ax88796.c
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ static const struct ethtool_ops ax_ethtool_ops = {
.set_settings = ax_set_settings,
.nway_reset = ax_nway_reset,
.get_link = ax_get_link,
.get_perm_addr = ethtool_op_get_perm_addr,
};

/* setup code */
Expand Down
1 change: 0 additions & 1 deletion drivers/net/b44.c
Original file line number Diff line number Diff line change
Expand Up @@ -2033,7 +2033,6 @@ static const struct ethtool_ops b44_ethtool_ops = {
.get_strings = b44_get_strings,
.get_stats_count = b44_get_stats_count,
.get_ethtool_stats = b44_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

static int b44_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/bnx2.c
Original file line number Diff line number Diff line change
Expand Up @@ -6269,7 +6269,6 @@ static const struct ethtool_ops bnx2_ethtool_ops = {
.phys_id = bnx2_phys_id,
.get_stats_count = bnx2_get_stats_count,
.get_ethtool_stats = bnx2_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

/* Called with rtnl_lock */
Expand Down
52 changes: 10 additions & 42 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,38 +613,20 @@ static int bond_set_carrier(struct bonding *bond)
static int bond_update_speed_duplex(struct slave *slave)
{
struct net_device *slave_dev = slave->dev;
static int (* ioctl)(struct net_device *, struct ifreq *, int);
struct ifreq ifr;
struct ethtool_cmd etool;
int res;

/* Fake speed and duplex */
slave->speed = SPEED_100;
slave->duplex = DUPLEX_FULL;

if (slave_dev->ethtool_ops) {
int res;

if (!slave_dev->ethtool_ops->get_settings) {
return -1;
}

res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
if (res < 0) {
return -1;
}

goto verify;
}
if (!slave_dev->ethtool_ops || !slave_dev->ethtool_ops->get_settings)
return -1;

ioctl = slave_dev->do_ioctl;
strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
etool.cmd = ETHTOOL_GSET;
ifr.ifr_data = (char*)&etool;
if (!ioctl || (IOCTL(slave_dev, &ifr, SIOCETHTOOL) < 0)) {
res = slave_dev->ethtool_ops->get_settings(slave_dev, &etool);
if (res < 0)
return -1;
}

verify:
switch (etool.speed) {
case SPEED_10:
case SPEED_100:
Expand Down Expand Up @@ -690,7 +672,6 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
static int (* ioctl)(struct net_device *, struct ifreq *, int);
struct ifreq ifr;
struct mii_ioctl_data *mii;
struct ethtool_value etool;

if (bond->params.use_carrier) {
return netif_carrier_ok(slave_dev) ? BMSR_LSTATUS : 0;
Expand Down Expand Up @@ -721,9 +702,10 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
}
}

/* try SIOCETHTOOL ioctl, some drivers cache ETHTOOL_GLINK */
/* for a period of time so we attempt to get link status */
/* from it last if the above MII ioctls fail... */
/*
* Some drivers cache ETHTOOL_GLINK for a period of time so we only
* attempt to get link status from it if the above MII ioctls fail.
*/
if (slave_dev->ethtool_ops) {
if (slave_dev->ethtool_ops->get_link) {
u32 link;
Expand All @@ -734,23 +716,9 @@ static int bond_check_dev_link(struct bonding *bond, struct net_device *slave_de
}
}

if (ioctl) {
strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
etool.cmd = ETHTOOL_GLINK;
ifr.ifr_data = (char*)&etool;
if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
if (etool.data == 1) {
return BMSR_LSTATUS;
} else {
dprintk("SIOCETHTOOL shows link down\n");
return 0;
}
}
}

/*
* If reporting, report that either there's no dev->do_ioctl,
* or both SIOCGMIIREG and SIOCETHTOOL failed (meaning that we
* or both SIOCGMIIREG and get_link failed (meaning that we
* cannot report link status). If not reporting, pretend
* we're ok.
*/
Expand Down
1 change: 0 additions & 1 deletion drivers/net/cxgb3/cxgb3_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,6 @@ static const struct ethtool_ops cxgb_ethtool_ops = {
.get_wol = get_wol,
.get_tso = ethtool_op_get_tso,
.set_tso = ethtool_op_set_tso,
.get_perm_addr = ethtool_op_get_perm_addr
};

static int in_range(int val, int lo, int hi)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -2506,7 +2506,6 @@ static const struct ethtool_ops e100_ethtool_ops = {
.phys_id = e100_phys_id,
.get_stats_count = e100_get_stats_count,
.get_ethtool_stats = e100_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

static int e100_do_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/e1000/e1000_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -1973,7 +1973,6 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.phys_id = e1000_phys_id,
.get_stats_count = e1000_get_stats_count,
.get_ethtool_stats = e1000_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

void e1000_set_ethtool_ops(struct net_device *netdev)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4707,7 +4707,6 @@ static const struct ethtool_ops ops = {
.get_regs_len = nv_get_regs_len,
.get_regs = nv_get_regs,
.nway_reset = nv_nway_reset,
.get_perm_addr = ethtool_op_get_perm_addr,
.get_tso = ethtool_op_get_tso,
.set_tso = nv_set_tso,
.get_ringparam = nv_get_ringparam,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ixgb/ixgb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,6 @@ static const struct ethtool_ops ixgb_ethtool_ops = {
.phys_id = ixgb_phys_id,
.get_stats_count = ixgb_get_stats_count,
.get_ethtool_stats = ixgb_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

void ixgb_set_ethtool_ops(struct net_device *netdev)
Expand Down
7 changes: 6 additions & 1 deletion drivers/net/loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,12 @@ struct net_device loopback_dev = {
/* Setup and register the loopback device. */
static int __init loopback_init(void)
{
return register_netdev(&loopback_dev);
int err = register_netdev(&loopback_dev);

if (err)
panic("loopback: Failed to register netdevice: %d\n", err);

return err;
};

module_init(loopback_init);
Expand Down
1 change: 0 additions & 1 deletion drivers/net/ne2k-pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,6 @@ static const struct ethtool_ops ne2k_pci_ethtool_ops = {
.get_drvinfo = ne2k_pci_get_drvinfo,
.get_tx_csum = ethtool_op_get_tx_csum,
.get_sg = ethtool_op_get_sg,
.get_perm_addr = ethtool_op_get_perm_addr,
};

static void __devexit ne2k_pci_remove_one (struct pci_dev *pdev)
Expand Down
1 change: 0 additions & 1 deletion drivers/net/netxen/netxen_nic_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -755,5 +755,4 @@ struct ethtool_ops netxen_nic_ethtool_ops = {
.get_strings = netxen_nic_get_strings,
.get_stats_count = netxen_nic_get_stats_count,
.get_ethtool_stats = netxen_nic_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};
1 change: 0 additions & 1 deletion drivers/net/pcnet32.c
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,6 @@ static const struct ethtool_ops pcnet32_ethtool_ops = {
.phys_id = pcnet32_phys_id,
.get_regs_len = pcnet32_get_regs_len,
.get_regs = pcnet32_get_regs,
.get_perm_addr = ethtool_op_get_perm_addr,
};

/* only probes for non-PCI devices, the rest are handled by
Expand Down
37 changes: 21 additions & 16 deletions drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,19 +108,24 @@ static inline int cmp_addr(struct pppoe_addr *a, unsigned long sid, char *addr)
(memcmp(a->remote,addr,ETH_ALEN) == 0));
}

static int hash_item(unsigned long sid, unsigned char *addr)
#if 8%PPPOE_HASH_BITS
#error 8 must be a multiple of PPPOE_HASH_BITS
#endif

static int hash_item(unsigned int sid, unsigned char *addr)
{
char hash = 0;
int i, j;
unsigned char hash = 0;
unsigned int i;

for (i = 0; i < ETH_ALEN ; ++i) {
for (j = 0; j < 8/PPPOE_HASH_BITS ; ++j) {
hash ^= addr[i] >> ( j * PPPOE_HASH_BITS );
}
for (i = 0 ; i < ETH_ALEN ; i++) {
hash ^= addr[i];
}
for (i = 0 ; i < sizeof(sid_t)*8 ; i += 8 ){
hash ^= sid>>i;
}
for (i = 8 ; (i>>=1) >= PPPOE_HASH_BITS ; ) {
hash ^= hash>>i;
}

for (i = 0; i < (sizeof(unsigned long)*8) / PPPOE_HASH_BITS ; ++i)
hash ^= sid >> (i*PPPOE_HASH_BITS);

return hash & ( PPPOE_HASH_SIZE - 1 );
}
Expand Down Expand Up @@ -664,8 +669,8 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
{
struct sock *sk = sock->sk;
struct pppox_sock *po = pppox_sk(sk);
int val = 0;
int err = 0;
int val;
int err;

switch (cmd) {
case PPPIOCGMRU:
Expand Down Expand Up @@ -754,8 +759,9 @@ static int pppoe_ioctl(struct socket *sock, unsigned int cmd,
err = 0;
break;

default:;
};
default:
err = -ENOTTY;
}

return err;
}
Expand All @@ -773,6 +779,7 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
struct net_device *dev;
char *start;

lock_sock(sk);
if (sock_flag(sk, SOCK_DEAD) || !(sk->sk_state & PPPOX_CONNECTED)) {
error = -ENOTCONN;
goto end;
Expand All @@ -783,8 +790,6 @@ static int pppoe_sendmsg(struct kiocb *iocb, struct socket *sock,
hdr.code = 0;
hdr.sid = po->num;

lock_sock(sk);

dev = po->pppoe_dev;

error = -EMSGSIZE;
Expand Down
11 changes: 4 additions & 7 deletions drivers/net/pppox.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
{
struct sock *sk = sock->sk;
struct pppox_sock *po = pppox_sk(sk);
int rc = 0;
int rc;

lock_sock(sk);

Expand All @@ -94,12 +94,9 @@ int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
break;
}
default:
if (pppox_protos[sk->sk_protocol]->ioctl)
rc = pppox_protos[sk->sk_protocol]->ioctl(sock, cmd,
arg);

break;
};
rc = pppox_protos[sk->sk_protocol]->ioctl ?
pppox_protos[sk->sk_protocol]->ioctl(sock, cmd, arg) : -ENOTTY;
}

release_sock(sk);
return rc;
Expand Down
1 change: 0 additions & 1 deletion drivers/net/qla3xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,6 @@ static void ql_get_pauseparam(struct net_device *ndev,
static const struct ethtool_ops ql3xxx_ethtool_ops = {
.get_settings = ql_get_settings,
.get_drvinfo = ql_get_drvinfo,
.get_perm_addr = ethtool_op_get_perm_addr,
.get_link = ethtool_op_get_link,
.get_msglevel = ql_get_msglevel,
.set_msglevel = ql_set_msglevel,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,6 @@ static const struct ethtool_ops rtl8169_ethtool_ops = {
.get_strings = rtl8169_get_strings,
.get_stats_count = rtl8169_get_stats_count,
.get_ethtool_stats = rtl8169_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

static void rtl8169_write_gmii_reg_bit(void __iomem *ioaddr, int reg,
Expand Down
1 change: 0 additions & 1 deletion drivers/net/sc92031.c
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,6 @@ static struct ethtool_ops sc92031_ethtool_ops = {
.get_strings = sc92031_ethtool_get_strings,
.get_stats_count = sc92031_ethtool_get_stats_count,
.get_ethtool_stats = sc92031_ethtool_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
.get_ufo = ethtool_op_get_ufo,
};

Expand Down
1 change: 0 additions & 1 deletion drivers/net/skge.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,6 @@ static const struct ethtool_ops skge_ethtool_ops = {
.phys_id = skge_phys_id,
.get_stats_count = skge_get_stats_count,
.get_ethtool_stats = skge_get_ethtool_stats,
.get_perm_addr = ethtool_op_get_perm_addr,
};

/*
Expand Down
Loading

0 comments on commit 0d6caa1

Please sign in to comment.