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: (24 commits)
  usbnet: Remove over-broad module alias from zaurus.
  MAINTAINERS: drop Michael from bfin_mac driver
  net/can: activate bit-timing calculation and netlink based drivers by default
  rionet: fix NULL pointer dereference in rionet_remove
  net+crypto: Use vmalloc for zlib inflate buffers.
  netfilter: Fix ip_route_me_harder triggering ip_rt_bug
  ipv4: Fix IPsec slowpath fragmentation problem
  ipv4: Fix packet size calculation in __ip_append_data
  cxgb3: skb_record_rx_queue now records the queue index relative to the net_device.
  bridge: Only flood unregistered groups to routers
  qlge: Add maintainer.
  MAINTAINERS: mark socketcan-core lists as subscribers-only
  MAINTAINERS: Remove Sven Eckelmann from BATMAN ADVANCED
  r8169: fix wrong register use.
  net/usb/kalmia: signedness bug in kalmia_bind()
  net/usb: kalmia: Various fixes for better support of non-x86 architectures.
  rtl8192cu: Fix missing firmware load
  udp/recvmsg: Clear MSG_TRUNC flag when starting over for a new packet
  ipv6/udp: Use the correct variable to determine non-blocking condition
  netconsole: fix build when CONFIG_NETCONSOLE_DYNAMIC is turned on
  ...
  • Loading branch information
torvalds committed Jun 30, 2011
2 parents 5fc3054 + 16adf5d commit 0e90ed0
Show file tree
Hide file tree
Showing 22 changed files with 155 additions and 134 deletions.
7 changes: 3 additions & 4 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,6 @@ F: include/linux/backlight.h
BATMAN ADVANCED
M: Marek Lindner <[email protected]>
M: Simon Wunderlich <[email protected]>
M: Sven Eckelmann <[email protected]>
L: [email protected]
W: http://www.open-mesh.org/
S: Maintained
Expand Down Expand Up @@ -1425,7 +1424,6 @@ S: Supported
F: arch/blackfin/

BLACKFIN EMAC DRIVER
M: Michael Hennerich <[email protected]>
L: [email protected]
W: http://blackfin.uclinux.org
S: Supported
Expand Down Expand Up @@ -1641,7 +1639,7 @@ CAN NETWORK LAYER
M: Oliver Hartkopp <[email protected]>
M: Oliver Hartkopp <[email protected]>
M: Urs Thuermann <[email protected]>
L: [email protected]
L: [email protected] (subscribers-only)
L: [email protected]
W: http://developer.berlios.de/projects/socketcan/
S: Maintained
Expand All @@ -1653,7 +1651,7 @@ F: include/linux/can/raw.h

CAN NETWORK DRIVERS
M: Wolfgang Grandegger <[email protected]>
L: [email protected]
L: [email protected] (subscribers-only)
L: [email protected]
W: http://developer.berlios.de/projects/socketcan/
S: Maintained
Expand Down Expand Up @@ -5183,6 +5181,7 @@ S: Supported
F: drivers/net/qlcnic/

QLOGIC QLGE 10Gb ETHERNET DRIVER
M: Jitendra Kalsaria <[email protected]>
M: Ron Mercer <[email protected]>
M: [email protected]
L: [email protected]
Expand Down
7 changes: 3 additions & 4 deletions crypto/deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/slab.h>

#define DEFLATE_DEF_LEVEL Z_DEFAULT_COMPRESSION
#define DEFLATE_DEF_WINBITS 11
Expand Down Expand Up @@ -73,7 +72,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
int ret = 0;
struct z_stream_s *stream = &ctx->decomp_stream;

stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
stream->workspace = vzalloc(zlib_inflate_workspacesize());
if (!stream->workspace) {
ret = -ENOMEM;
goto out;
Expand All @@ -86,7 +85,7 @@ static int deflate_decomp_init(struct deflate_ctx *ctx)
out:
return ret;
out_free:
kfree(stream->workspace);
vfree(stream->workspace);
goto out;
}

Expand All @@ -99,7 +98,7 @@ static void deflate_comp_exit(struct deflate_ctx *ctx)
static void deflate_decomp_exit(struct deflate_ctx *ctx)
{
zlib_inflateEnd(&ctx->decomp_stream);
kfree(ctx->decomp_stream.workspace);
vfree(ctx->decomp_stream.workspace);
}

static int deflate_init(struct crypto_tfm *tfm)
Expand Down
7 changes: 3 additions & 4 deletions crypto/zlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include <linux/interrupt.h>
#include <linux/mm.h>
#include <linux/net.h>
#include <linux/slab.h>

#include <crypto/internal/compress.h>

Expand Down Expand Up @@ -60,7 +59,7 @@ static void zlib_decomp_exit(struct zlib_ctx *ctx)

if (stream->workspace) {
zlib_inflateEnd(stream);
kfree(stream->workspace);
vfree(stream->workspace);
stream->workspace = NULL;
}
}
Expand Down Expand Up @@ -228,13 +227,13 @@ static int zlib_decompress_setup(struct crypto_pcomp *tfm, void *params,
? nla_get_u32(tb[ZLIB_DECOMP_WINDOWBITS])
: DEF_WBITS;

stream->workspace = kzalloc(zlib_inflate_workspacesize(), GFP_KERNEL);
stream->workspace = vzalloc(zlib_inflate_workspacesize());
if (!stream->workspace)
return -ENOMEM;

ret = zlib_inflateInit2(stream, ctx->decomp_windowBits);
if (ret != Z_OK) {
kfree(stream->workspace);
vfree(stream->workspace);
stream->workspace = NULL;
return -EINVAL;
}
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3416,7 +3416,8 @@ config NETCONSOLE

config NETCONSOLE_DYNAMIC
bool "Dynamic reconfiguration of logging targets"
depends on NETCONSOLE && SYSFS && CONFIGFS_FS
depends on NETCONSOLE && SYSFS && CONFIGFS_FS && \
!(NETCONSOLE=y && CONFIGFS_FS=m)
help
This option enables the ability to dynamically reconfigure target
parameters (interface, IP addresses, port numbers, MAC addresses)
Expand Down
6 changes: 3 additions & 3 deletions drivers/net/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <linux/zlib.h>
#include <linux/io.h>
#include <linux/stringify.h>
#include <linux/vmalloc.h>

#define BNX2X_MAIN
#include "bnx2x.h"
Expand Down Expand Up @@ -4537,8 +4538,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
if (bp->strm == NULL)
goto gunzip_nomem2;

bp->strm->workspace = kmalloc(zlib_inflate_workspacesize(),
GFP_KERNEL);
bp->strm->workspace = vmalloc(zlib_inflate_workspacesize());
if (bp->strm->workspace == NULL)
goto gunzip_nomem3;

Expand All @@ -4562,7 +4562,7 @@ static int bnx2x_gunzip_init(struct bnx2x *bp)
static void bnx2x_gunzip_end(struct bnx2x *bp)
{
if (bp->strm) {
kfree(bp->strm->workspace);
vfree(bp->strm->workspace);
kfree(bp->strm);
bp->strm = NULL;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/can/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ config CAN_SLCAN
config CAN_DEV
tristate "Platform CAN drivers with Netlink support"
depends on CAN
default Y
default y
---help---
Enables the common framework for platform CAN drivers with Netlink
support. This is the standard library for CAN drivers.
Expand All @@ -45,7 +45,7 @@ config CAN_DEV
config CAN_CALC_BITTIMING
bool "CAN bit-timing calculation"
depends on CAN_DEV
default Y
default y
---help---
If enabled, CAN bit-timing parameters will be calculated for the
bit-rate specified via Netlink argument "bitrate" when the device
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/cxgb3/sge.c
Original file line number Diff line number Diff line change
Expand Up @@ -2026,7 +2026,7 @@ static void rx_eth(struct adapter *adap, struct sge_rspq *rq,
skb->ip_summed = CHECKSUM_UNNECESSARY;
} else
skb_checksum_none_assert(skb);
skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);

if (unlikely(p->vlan_valid)) {
struct vlan_group *grp = pi->vlan_grp;
Expand Down Expand Up @@ -2145,7 +2145,7 @@ static void lro_add_page(struct adapter *adap, struct sge_qset *qs,
if (!complete)
return;

skb_record_rx_queue(skb, qs - &adap->sge.qs[0]);
skb_record_rx_queue(skb, qs - &adap->sge.qs[pi->first_qset]);

if (unlikely(cpl->vlan_valid)) {
struct vlan_group *grp = pi->vlan_grp;
Expand Down
5 changes: 2 additions & 3 deletions drivers/net/ppp_deflate.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ static void z_decomp_free(void *arg)

if (state) {
zlib_inflateEnd(&state->strm);
kfree(state->strm.workspace);
vfree(state->strm.workspace);
kfree(state);
}
}
Expand Down Expand Up @@ -345,8 +345,7 @@ static void *z_decomp_alloc(unsigned char *options, int opt_len)

state->w_size = w_size;
state->strm.next_out = NULL;
state->strm.workspace = kmalloc(zlib_inflate_workspacesize(),
GFP_KERNEL|__GFP_REPEAT);
state->strm.workspace = vmalloc(zlib_inflate_workspacesize());
if (state->strm.workspace == NULL)
goto out_free;

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
msleep(2);
for (i = 0; i < 5; i++) {
udelay(100);
if (!(RTL_R32(ERIDR) & ERIAR_FLAG))
if (!(RTL_R32(ERIAR) & ERIAR_FLAG))
break;
}

Expand Down
28 changes: 15 additions & 13 deletions drivers/net/rionet.c
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ static int rionet_close(struct net_device *ndev)

static void rionet_remove(struct rio_dev *rdev)
{
struct net_device *ndev = NULL;
struct net_device *ndev = rio_get_drvdata(rdev);
struct rionet_peer *peer, *tmp;

free_pages((unsigned long)rionet_active, rdev->net->hport->sys_size ?
Expand Down Expand Up @@ -433,22 +433,12 @@ static const struct net_device_ops rionet_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
};

static int rionet_setup_netdev(struct rio_mport *mport)
static int rionet_setup_netdev(struct rio_mport *mport, struct net_device *ndev)
{
int rc = 0;
struct net_device *ndev = NULL;
struct rionet_private *rnet;
u16 device_id;

/* Allocate our net_device structure */
ndev = alloc_etherdev(sizeof(struct rionet_private));
if (ndev == NULL) {
printk(KERN_INFO "%s: could not allocate ethernet device.\n",
DRV_NAME);
rc = -ENOMEM;
goto out;
}

rionet_active = (struct rio_dev **)__get_free_pages(GFP_KERNEL,
mport->sys_size ? __fls(sizeof(void *)) + 4 : 0);
if (!rionet_active) {
Expand Down Expand Up @@ -504,11 +494,21 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
int rc = -ENODEV;
u32 lpef, lsrc_ops, ldst_ops;
struct rionet_peer *peer;
struct net_device *ndev = NULL;

/* If local device is not rionet capable, give up quickly */
if (!rionet_capable)
goto out;

/* Allocate our net_device structure */
ndev = alloc_etherdev(sizeof(struct rionet_private));
if (ndev == NULL) {
printk(KERN_INFO "%s: could not allocate ethernet device.\n",
DRV_NAME);
rc = -ENOMEM;
goto out;
}

/*
* First time through, make sure local device is rionet
* capable, setup netdev, and set flags so this is skipped
Expand All @@ -529,7 +529,7 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
goto out;
}

rc = rionet_setup_netdev(rdev->net->hport);
rc = rionet_setup_netdev(rdev->net->hport, ndev);
rionet_check = 1;
}

Expand All @@ -546,6 +546,8 @@ static int rionet_probe(struct rio_dev *rdev, const struct rio_device_id *id)
list_add_tail(&peer->node, &rionet_peers);
}

rio_set_drvdata(rdev, ndev);

out:
return rc;
}
Expand Down
42 changes: 25 additions & 17 deletions drivers/net/usb/kalmia.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,34 +100,42 @@ kalmia_send_init_packet(struct usbnet *dev, u8 *init_msg, u8 init_msg_len,
static int
kalmia_init_and_get_ethernet_addr(struct usbnet *dev, u8 *ethernet_addr)
{
char init_msg_1[] =
const static char init_msg_1[] =
{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00,
0x00, 0x00 };
char init_msg_2[] =
const static char init_msg_2[] =
{ 0x57, 0x50, 0x04, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xf4,
0x00, 0x00 };
char receive_buf[28];
const static int buflen = 28;
char *usb_buf;
int status;

status = kalmia_send_init_packet(dev, init_msg_1, sizeof(init_msg_1)
/ sizeof(init_msg_1[0]), receive_buf, 24);
usb_buf = kmalloc(buflen, GFP_DMA | GFP_KERNEL);
if (!usb_buf)
return -ENOMEM;

memcpy(usb_buf, init_msg_1, 12);
status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_1)
/ sizeof(init_msg_1[0]), usb_buf, 24);
if (status != 0)
return status;

status = kalmia_send_init_packet(dev, init_msg_2, sizeof(init_msg_2)
/ sizeof(init_msg_2[0]), receive_buf, 28);
memcpy(usb_buf, init_msg_2, 12);
status = kalmia_send_init_packet(dev, usb_buf, sizeof(init_msg_2)
/ sizeof(init_msg_2[0]), usb_buf, 28);
if (status != 0)
return status;

memcpy(ethernet_addr, receive_buf + 10, ETH_ALEN);
memcpy(ethernet_addr, usb_buf + 10, ETH_ALEN);

kfree(usb_buf);
return status;
}

static int
kalmia_bind(struct usbnet *dev, struct usb_interface *intf)
{
u8 status;
int status;
u8 ethernet_addr[ETH_ALEN];

/* Don't bind to AT command interface */
Expand Down Expand Up @@ -190,7 +198,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
dev_kfree_skb_any(skb);
skb = skb2;

done: header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
done:
header_start = skb_push(skb, KALMIA_HEADER_LENGTH);
ether_type_1 = header_start[KALMIA_HEADER_LENGTH + 12];
ether_type_2 = header_start[KALMIA_HEADER_LENGTH + 13];

Expand All @@ -201,9 +210,8 @@ kalmia_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
header_start[0] = 0x57;
header_start[1] = 0x44;
content_len = skb->len - KALMIA_HEADER_LENGTH;
header_start[2] = (content_len & 0xff); /* low byte */
header_start[3] = (content_len >> 8); /* high byte */

put_unaligned_le16(content_len, &header_start[2]);
header_start[4] = ether_type_1;
header_start[5] = ether_type_2;

Expand Down Expand Up @@ -231,13 +239,13 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
* Our task here is to strip off framing, leaving skb with one
* data frame for the usbnet framework code to process.
*/
const u8 HEADER_END_OF_USB_PACKET[] =
const static u8 HEADER_END_OF_USB_PACKET[] =
{ 0x57, 0x5a, 0x00, 0x00, 0x08, 0x00 };
const u8 EXPECTED_UNKNOWN_HEADER_1[] =
const static u8 EXPECTED_UNKNOWN_HEADER_1[] =
{ 0x57, 0x43, 0x1e, 0x00, 0x15, 0x02 };
const u8 EXPECTED_UNKNOWN_HEADER_2[] =
const static u8 EXPECTED_UNKNOWN_HEADER_2[] =
{ 0x57, 0x50, 0x0e, 0x00, 0x00, 0x00 };
u8 i = 0;
int i = 0;

/* incomplete header? */
if (skb->len < KALMIA_HEADER_LENGTH)
Expand Down Expand Up @@ -285,7 +293,7 @@ kalmia_rx_fixup(struct usbnet *dev, struct sk_buff *skb)

/* subtract start header and end header */
usb_packet_length = skb->len - (2 * KALMIA_HEADER_LENGTH);
ether_packet_length = header_start[2] + (header_start[3] << 8);
ether_packet_length = get_unaligned_le16(&header_start[2]);
skb_pull(skb, KALMIA_HEADER_LENGTH);

/* Some small packets misses end marker */
Expand Down
Loading

0 comments on commit 0e90ed0

Please sign in to comment.