Skip to content

Commit

Permalink
Merge branch 'upstream-davem' of master.kernel.org:/pub/scm/linux/ker…
Browse files Browse the repository at this point in the history
…nel/git/jgarzik/netdev-2.6
  • Loading branch information
David S. Miller committed Aug 7, 2008
2 parents 6edafaa + 3859069 commit 32bb93b
Show file tree
Hide file tree
Showing 102 changed files with 2,325 additions and 3,200 deletions.
38 changes: 12 additions & 26 deletions Documentation/DocBook/z8530book.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,6 @@
device to be used as both a tty interface and as a synchronous
controller is a project for Linux post the 2.4 release
</para>
<para>
The support code handles most common card configurations and
supports running both Cisco HDLC and Synchronous PPP. With extra
glue the frame relay and X.25 protocols can also be used with this
driver.
</para>
</chapter>

<chapter id="Driver_Modes">
Expand Down Expand Up @@ -179,35 +173,27 @@
<para>
If you wish to use the network interface facilities of the driver,
then you need to attach a network device to each channel that is
present and in use. In addition to use the SyncPPP and Cisco HDLC
present and in use. In addition to use the generic HDLC
you need to follow some additional plumbing rules. They may seem
complex but a look at the example hostess_sv11 driver should
reassure you.
</para>
<para>
The network device used for each channel should be pointed to by
the netdevice field of each channel. The dev-&gt; priv field of the
the netdevice field of each channel. The hdlc-&gt; priv field of the
network device points to your private data - you will need to be
able to find your ppp device from this. In addition to use the
sync ppp layer the private data must start with a void * pointer
to the syncppp structures.
able to find your private data from this.
</para>
<para>
The way most drivers approach this particular problem is to
create a structure holding the Z8530 device definition and
put that and the syncppp pointer into the private field of
the network device. The network device fields of the channels
then point back to the network devices. The ppp_device can also
be put in the private structure conveniently.
put that into the private field of the network device. The
network device fields of the channels then point back to the
network devices.
</para>
<para>
If you wish to use the synchronous ppp then you need to attach
the syncppp layer to the network device. You should do this before
you register the network device. The
<function>sppp_attach</function> requires that the first void *
pointer in your private data is pointing to an empty struct
ppp_device. The function fills in the initial data for the
ppp/hdlc layer.
If you wish to use the generic HDLC then you need to register
the HDLC device.
</para>
<para>
Before you register your network device you will also need to
Expand Down Expand Up @@ -314,10 +300,10 @@
buffer in sk_buff format and queues it for transmission. The
caller must provide the entire packet with the exception of the
bitstuffing and CRC. This is normally done by the caller via
the syncppp interface layer. It returns 0 if the buffer has been
queued and non zero values for queue full. If the function accepts
the buffer it becomes property of the Z8530 layer and the caller
should not free it.
the generic HDLC interface layer. It returns 0 if the buffer has been
queued and non zero values for queue full. If the function accepts
the buffer it becomes property of the Z8530 layer and the caller
should not free it.
</para>
<para>
The function <function>z8530_get_stats</function> returns a pointer
Expand Down
11 changes: 11 additions & 0 deletions arch/sh/include/asm/sh_eth.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#ifndef __ASM_SH_ETH_H__
#define __ASM_SH_ETH_H__

enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};

struct sh_eth_plat_data {
int phy;
int edmac_endian;
};

#endif
4 changes: 0 additions & 4 deletions drivers/char/pcmcia/synclink_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ typedef struct _mgslpc_info {

/* SPPP/Cisco HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;

#if SYNCLINK_GENERIC_HDLC
Expand Down Expand Up @@ -459,13 +458,11 @@ static int ttymajor=0;

static int debug_level = 0;
static int maxframe[MAX_DEVICE_COUNT] = {0,};
static int dosyncppp[MAX_DEVICE_COUNT] = {1,1,1,1};

module_param(break_on_load, bool, 0);
module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);

MODULE_LICENSE("GPL");

Expand Down Expand Up @@ -2915,7 +2912,6 @@ static void mgslpc_add_device(MGSLPC_INFO *info)
if (info->line < MAX_DEVICE_COUNT) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}

mgslpc_device_count++;
Expand Down
4 changes: 0 additions & 4 deletions drivers/char/synclink.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ struct mgsl_struct {

/* generic HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;

#if SYNCLINK_GENERIC_HDLC
Expand Down Expand Up @@ -868,7 +867,6 @@ static int irq[MAX_ISA_DEVICES];
static int dma[MAX_ISA_DEVICES];
static int debug_level;
static int maxframe[MAX_TOTAL_DEVICES];
static int dosyncppp[MAX_TOTAL_DEVICES];
static int txdmabufs[MAX_TOTAL_DEVICES];
static int txholdbufs[MAX_TOTAL_DEVICES];

Expand All @@ -879,7 +877,6 @@ module_param_array(irq, int, NULL, 0);
module_param_array(dma, int, NULL, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);
module_param_array(txdmabufs, int, NULL, 0);
module_param_array(txholdbufs, int, NULL, 0);

Expand Down Expand Up @@ -4258,7 +4255,6 @@ static void mgsl_add_device( struct mgsl_struct *info )
if (info->line < MAX_TOTAL_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];

if (txdmabufs[info->line]) {
info->num_tx_dma_buffers = txdmabufs[info->line];
Expand Down
5 changes: 0 additions & 5 deletions drivers/char/synclink_gt.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,14 @@ static int slgt_device_count;
static int ttymajor;
static int debug_level;
static int maxframe[MAX_DEVICES];
static int dosyncppp[MAX_DEVICES];

module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);

MODULE_PARM_DESC(ttymajor, "TTY major device number override: 0=auto assigned");
MODULE_PARM_DESC(debug_level, "Debug syslog output: 0=disabled, 1 to 5=increasing detail");
MODULE_PARM_DESC(maxframe, "Maximum frame size used by device (4096 to 65535)");
MODULE_PARM_DESC(dosyncppp, "Enable synchronous net device, 0=disable 1=enable");

/*
* tty support and callbacks
Expand Down Expand Up @@ -349,7 +346,6 @@ struct slgt_info {
/* SPPP/Cisco HDLC device parts */

int netcount;
int dosyncppp;
spinlock_t netlock;
#if SYNCLINK_GENERIC_HDLC
struct net_device *netdev;
Expand Down Expand Up @@ -3405,7 +3401,6 @@ static void add_device(struct slgt_info *info)
if (info->line < MAX_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}

slgt_device_count++;
Expand Down
4 changes: 0 additions & 4 deletions drivers/char/synclinkmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ typedef struct _synclinkmp_info {

/* SPPP/Cisco HDLC device parts */
int netcount;
int dosyncppp;
spinlock_t netlock;

#if SYNCLINK_GENERIC_HDLC
Expand Down Expand Up @@ -469,13 +468,11 @@ static int ttymajor = 0;
*/
static int debug_level = 0;
static int maxframe[MAX_DEVICES] = {0,};
static int dosyncppp[MAX_DEVICES] = {0,};

module_param(break_on_load, bool, 0);
module_param(ttymajor, int, 0);
module_param(debug_level, int, 0);
module_param_array(maxframe, int, NULL, 0);
module_param_array(dosyncppp, int, NULL, 0);

static char *driver_name = "SyncLink MultiPort driver";
static char *driver_version = "$Revision: 4.38 $";
Expand Down Expand Up @@ -3752,7 +3749,6 @@ static void add_device(SLMP_INFO *info)
if (info->line < MAX_DEVICES) {
if (maxframe[info->line])
info->max_frame_size = maxframe[info->line];
info->dosyncppp = dosyncppp[info->line];
}

synclinkmp_device_count++;
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/3c523.c
Original file line number Diff line number Diff line change
Expand Up @@ -640,10 +640,8 @@ static int init586(struct net_device *dev)
cfg_cmd->time_low = 0x00;
cfg_cmd->time_high = 0xf2;
cfg_cmd->promisc = 0;
if (dev->flags & (IFF_ALLMULTI | IFF_PROMISC)) {
if (dev->flags & (IFF_ALLMULTI | IFF_PROMISC))
cfg_cmd->promisc = 1;
dev->flags |= IFF_PROMISC;
}
cfg_cmd->carr_coll = 0x00;

p->scb->cbl_offset = make16(cfg_cmd);
Expand Down
9 changes: 3 additions & 6 deletions drivers/net/3c527.c
Original file line number Diff line number Diff line change
Expand Up @@ -1521,14 +1521,11 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
struct mc32_local *lp = netdev_priv(dev);
u16 filt = (1<<2); /* Save Bad Packets, for stats purposes */

if (dev->flags&IFF_PROMISC)
if ((dev->flags&IFF_PROMISC) ||
(dev->flags&IFF_ALLMULTI) ||
dev->mc_count > 10)
/* Enable promiscuous mode */
filt |= 1;
else if((dev->flags&IFF_ALLMULTI) || dev->mc_count > 10)
{
dev->flags|=IFF_PROMISC;
filt |= 1;
}
else if(dev->mc_count)
{
unsigned char block[62];
Expand Down
14 changes: 8 additions & 6 deletions drivers/net/3c59x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1692,12 +1692,14 @@ vortex_open(struct net_device *dev)
vp->rx_ring[i].next = cpu_to_le32(vp->rx_ring_dma + sizeof(struct boom_rx_desc) * (i+1));
vp->rx_ring[i].status = 0; /* Clear complete bit. */
vp->rx_ring[i].length = cpu_to_le32(PKT_BUF_SZ | LAST_FRAG);
skb = dev_alloc_skb(PKT_BUF_SZ);

skb = __netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN,
GFP_KERNEL);
vp->rx_skbuff[i] = skb;
if (skb == NULL)
break; /* Bad news! */
skb->dev = dev; /* Mark as being used by this device. */
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */

skb_reserve(skb, NET_IP_ALIGN); /* Align IP on 16 byte boundaries */
vp->rx_ring[i].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
}
if (i != RX_RING_SIZE) {
Expand Down Expand Up @@ -2538,7 +2540,7 @@ boomerang_rx(struct net_device *dev)
struct sk_buff *skb;
entry = vp->dirty_rx % RX_RING_SIZE;
if (vp->rx_skbuff[entry] == NULL) {
skb = dev_alloc_skb(PKT_BUF_SZ);
skb = netdev_alloc_skb(dev, PKT_BUF_SZ + NET_IP_ALIGN);
if (skb == NULL) {
static unsigned long last_jif;
if (time_after(jiffies, last_jif + 10 * HZ)) {
Expand All @@ -2549,8 +2551,8 @@ boomerang_rx(struct net_device *dev)
mod_timer(&vp->rx_oom_timer, RUN_AT(HZ * 1));
break; /* Bad news! */
}
skb->dev = dev; /* Mark as being used by this device. */
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */

skb_reserve(skb, NET_IP_ALIGN);
vp->rx_ring[entry].addr = cpu_to_le32(pci_map_single(VORTEX_PCI(vp), skb->data, PKT_BUF_SZ, PCI_DMA_FROMDEVICE));
vp->rx_skbuff[entry] = skb;
}
Expand Down
13 changes: 5 additions & 8 deletions drivers/net/8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,42 +9,39 @@ int ei_open(struct net_device *dev)
{
return __ei_open(dev);
}
EXPORT_SYMBOL(ei_open);

int ei_close(struct net_device *dev)
{
return __ei_close(dev);
}
EXPORT_SYMBOL(ei_close);

irqreturn_t ei_interrupt(int irq, void *dev_id)
{
return __ei_interrupt(irq, dev_id);
}
EXPORT_SYMBOL(ei_interrupt);

#ifdef CONFIG_NET_POLL_CONTROLLER
void ei_poll(struct net_device *dev)
{
__ei_poll(dev);
}
EXPORT_SYMBOL(ei_poll);
#endif

struct net_device *__alloc_ei_netdev(int size)
{
return ____alloc_ei_netdev(size);
}
EXPORT_SYMBOL(__alloc_ei_netdev);

void NS8390_init(struct net_device *dev, int startp)
{
__NS8390_init(dev, startp);
}

EXPORT_SYMBOL(ei_open);
EXPORT_SYMBOL(ei_close);
EXPORT_SYMBOL(ei_interrupt);
#ifdef CONFIG_NET_POLL_CONTROLLER
EXPORT_SYMBOL(ei_poll);
#endif
EXPORT_SYMBOL(NS8390_init);
EXPORT_SYMBOL(__alloc_ei_netdev);

#if defined(MODULE)

Expand Down
19 changes: 8 additions & 11 deletions drivers/net/8390p.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,52 +4,49 @@ static const char version[] =
"8390p.c:v1.10cvs 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";

#define ei_inb(_p) inb(_p)
#define ei_outb(_v,_p) outb(_v,_p)
#define ei_outb(_v, _p) outb(_v, _p)
#define ei_inb_p(_p) inb_p(_p)
#define ei_outb_p(_v,_p) outb_p(_v,_p)
#define ei_outb_p(_v, _p) outb_p(_v, _p)

#include "lib8390.c"

int eip_open(struct net_device *dev)
{
return __ei_open(dev);
}
EXPORT_SYMBOL(eip_open);

int eip_close(struct net_device *dev)
{
return __ei_close(dev);
}
EXPORT_SYMBOL(eip_close);

irqreturn_t eip_interrupt(int irq, void *dev_id)
{
return __ei_interrupt(irq, dev_id);
}
EXPORT_SYMBOL(eip_interrupt);

#ifdef CONFIG_NET_POLL_CONTROLLER
void eip_poll(struct net_device *dev)
{
__ei_poll(dev);
}
EXPORT_SYMBOL(eip_poll);
#endif

struct net_device *__alloc_eip_netdev(int size)
{
return ____alloc_ei_netdev(size);
}
EXPORT_SYMBOL(__alloc_eip_netdev);

void NS8390p_init(struct net_device *dev, int startp)
{
return __NS8390_init(dev, startp);
__NS8390_init(dev, startp);
}

EXPORT_SYMBOL(eip_open);
EXPORT_SYMBOL(eip_close);
EXPORT_SYMBOL(eip_interrupt);
#ifdef CONFIG_NET_POLL_CONTROLLER
EXPORT_SYMBOL(eip_poll);
#endif
EXPORT_SYMBOL(NS8390p_init);
EXPORT_SYMBOL(__alloc_eip_netdev);

#if defined(MODULE)

Expand Down
Loading

0 comments on commit 32bb93b

Please sign in to comment.