Commit 1697b806 authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/jgarzik/net-drivers-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 2cd16b83 f755fa58
......@@ -721,7 +721,7 @@ static void __attach_bond_to_agg(struct port *port)
}
/**
* __detach_bond_to_agg
* __detach_bond_from_agg
* @port: the port we're looking at
*
* Handle the detaching of the port's control parser/multiplexer from the
......@@ -828,6 +828,55 @@ static struct aggregator *__get_active_agg(struct aggregator *aggregator)
return retval;
}
/**
* __update_lacpdu_from_port - update a port's lacpdu fields
* @port: the port we're looking at
*
*/
static inline void __update_lacpdu_from_port(struct port *port)
{
struct lacpdu *lacpdu = &port->lacpdu;
/* update current actual Actor parameters */
/* lacpdu->subtype initialized
* lacpdu->version_number initialized
* lacpdu->tlv_type_actor_info initialized
* lacpdu->actor_information_length initialized
*/
lacpdu->actor_system_priority = port->actor_system_priority;
lacpdu->actor_system = port->actor_system;
lacpdu->actor_key = port->actor_oper_port_key;
lacpdu->actor_port_priority = port->actor_port_priority;
lacpdu->actor_port = port->actor_port_number;
lacpdu->actor_state = port->actor_oper_port_state;
/* lacpdu->reserved_3_1 initialized
* lacpdu->tlv_type_partner_info initialized
* lacpdu->partner_information_length initialized
*/
lacpdu->partner_system_priority = port->partner_oper_system_priority;
lacpdu->partner_system = port->partner_oper_system;
lacpdu->partner_key = port->partner_oper_key;
lacpdu->partner_port_priority = port->partner_oper_port_priority;
lacpdu->partner_port = port->partner_oper_port_number;
lacpdu->partner_state = port->partner_oper_port_state;
/* lacpdu->reserved_3_2 initialized
* lacpdu->tlv_type_collector_info initialized
* lacpdu->collector_information_length initialized
* collector_max_delay initialized
* reserved_12[12] initialized
* tlv_type_terminator initialized
* terminator_length initialized
* reserved_50[50] initialized
*/
/* Convert all non u8 parameters to Big Endian for transmit */
__ntohs_lacpdu(lacpdu);
}
//////////////////////////////////////////////////////////////////////////////////////
// ================= main 802.3ad protocol code ======================================
//////////////////////////////////////////////////////////////////////////////////////
......@@ -1177,43 +1226,11 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
*/
static void ad_tx_machine(struct port *port)
{
struct lacpdu *lacpdu = &port->lacpdu;
// check if tx timer expired, to verify that we do not send more than 3 packets per second
if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) {
// check if there is something to send
if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) {
//update current actual Actor parameters
//lacpdu->subtype initialized
//lacpdu->version_number initialized
//lacpdu->tlv_type_actor_info initialized
//lacpdu->actor_information_length initialized
lacpdu->actor_system_priority = port->actor_system_priority;
lacpdu->actor_system = port->actor_system;
lacpdu->actor_key = port->actor_oper_port_key;
lacpdu->actor_port_priority = port->actor_port_priority;
lacpdu->actor_port = port->actor_port_number;
lacpdu->actor_state = port->actor_oper_port_state;
//lacpdu->reserved_3_1 initialized
//lacpdu->tlv_type_partner_info initialized
//lacpdu->partner_information_length initialized
lacpdu->partner_system_priority = port->partner_oper_system_priority;
lacpdu->partner_system = port->partner_oper_system;
lacpdu->partner_key = port->partner_oper_key;
lacpdu->partner_port_priority = port->partner_oper_port_priority;
lacpdu->partner_port = port->partner_oper_port_number;
lacpdu->partner_state = port->partner_oper_port_state;
//lacpdu->reserved_3_2 initialized
//lacpdu->tlv_type_collector_info initialized
//lacpdu->collector_information_length initialized
//collector_max_delay initialized
//reserved_12[12] initialized
//tlv_type_terminator initialized
//terminator_length initialized
//reserved_50[50] initialized
// We need to convert all non u8 parameters to Big Endian for transmit
__ntohs_lacpdu(lacpdu);
__update_lacpdu_from_port(port);
// send the lacpdu
if (ad_lacpdu_send(port) >= 0) {
BOND_PRINT_DBG(("Sent LACPDU on port %d", port->actor_port_number));
......@@ -1971,13 +1988,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
return;
}
// disable the port
ad_disable_collecting_distributing(port);
BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier));
// deinitialize port's locks if necessary(os-specific)
__deinitialize_port_locks(port);
/* Tell the partner that this port is not suitable for aggregation */
port->actor_oper_port_state &= ~AD_STATE_AGGREGATION;
__update_lacpdu_from_port(port);
ad_lacpdu_send(port);
BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier));
// check if this aggregator is occupied
if (aggregator->lag_ports) {
// check if there are other ports related to this aggregator except
......
......@@ -2220,7 +2220,7 @@ static void bond_mii_monitor(struct net_device *master)
}
printk(KERN_INFO
"%s: link status definitely down "
"for interface %s, disabling it\n",
"for interface %s, disabling it",
master->name,
dev->name);
......@@ -2994,6 +2994,7 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd)
struct ifbond *u_binfo = NULL, k_binfo;
struct ifslave *u_sinfo = NULL, k_sinfo;
struct mii_ioctl_data *mii = NULL;
int prev_abi_ver = orig_app_abi_ver;
int ret = 0;
#ifdef BONDING_DEBUG
......@@ -3112,6 +3113,15 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd)
}
dev_put(slave_dev);
}
if (ret < 0) {
/* The ioctl failed, so there's no point in changing the
* orig_app_abi_ver. We'll restore it's value just in case
* we've changed it earlier in this function.
*/
orig_app_abi_ver = prev_abi_ver;
}
return ret;
}
......
......@@ -1715,7 +1715,7 @@ static int autodetect;
static int n_eepro;
/* For linux 2.1.xx */
MODULE_AUTHOR("Pascal Dupuis <dupuis@lei.ucl.ac.be> for the 2.1 stuff (locking,...)");
MODULE_AUTHOR("Pascal Dupuis, and aris@cathedrallabs.org");
MODULE_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver");
MODULE_LICENSE("GPL");
......
......@@ -84,11 +84,14 @@
- Fix bug of custom mac address
(StationAddr register only accept word write)
Version LK1.09 (D-Link):
- Fix the flowctrl bug.
- Set Pause bit in MII ANAR if flow control enabled.
*/
#define DRV_NAME "sundance"
#define DRV_VERSION "1.01+LK1.08a"
#define DRV_RELDATE "23-Apr-2003"
#define DRV_VERSION "1.01+LK1.09a"
#define DRV_RELDATE "16-May-2003"
/* The user-configurable values.
......@@ -671,8 +674,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
np->an_enable = 1;
}
}
if (flowctrl == 0)
np->flowctrl = 0;
if (flowctrl == 1)
np->flowctrl = 1;
}
/* Fibre PHY? */
......@@ -687,6 +690,9 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
/* Reset PHY */
mdio_write (dev, np->phys[0], MII_BMCR, BMCR_RESET);
mdelay (300);
/* If flow control enabled, we need to advertise it.*/
if (np->flowctrl)
mdio_write (dev, np->phys[0], MII_ADVERTISE, np->mii_if.advertising | 0x0400);
mdio_write (dev, np->phys[0], MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART);
/* Force media type */
if (!np->an_enable) {
......@@ -935,7 +941,7 @@ static void check_duplex(struct net_device *dev)
printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d "
"negotiated capability %4.4x.\n", dev->name,
duplex ? "full" : "half", np->phys[0], negotiated);
writew(duplex ? 0x20 : 0, ioaddr + MACCtrl0);
writew(readw(ioaddr + MACCtrl0) | duplex ? 0x20 : 0, ioaddr + MACCtrl0);
}
}
......@@ -1455,9 +1461,12 @@ static void netdev_error(struct net_device *dev, int intr_status)
"full" : "half");
}
check_duplex (dev);
if (np->flowctrl == 0)
writew(readw(ioaddr + MACCtrl0) & ~EnbFlowCtrl,
if (np->flowctrl && np->mii_if.full_duplex) {
writew(readw(ioaddr + MulticastFilter1+2) | 0x0200,
ioaddr + MulticastFilter1+2);
writew(readw(ioaddr + MACCtrl0) | EnbFlowCtrl,
ioaddr + MACCtrl0);
}
}
if (intr_status & StatsMax) {
get_stats(dev);
......@@ -1500,6 +1509,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
static void set_rx_mode(struct net_device *dev)
{
long ioaddr = dev->base_addr;
struct netdev_private *np = dev->priv;
u16 mc_filter[4]; /* Multicast hash filter */
u32 rx_mode;
int i;
......@@ -1532,6 +1542,9 @@ static void set_rx_mode(struct net_device *dev)
writeb(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode);
return;
}
if (np->mii_if.full_duplex && np->flowctrl)
mc_filter[3] |= 0x0200;
for (i = 0; i < 4; i++)
writew(mc_filter[i], ioaddr + MulticastFilter0 + i*2);
writeb(rx_mode, ioaddr + RxMode);
......
......@@ -2,9 +2,7 @@
#include <linux/types.h>
#include <linux/netdevice.h>
#include <linux/interrupt.h>
#include <linux/version.h>
#include "lmc_ver.h"
#include "lmc_debug.h"
/*
......
This diff is collapsed.
/* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */
#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/string.h>
......@@ -11,9 +10,6 @@
#include <linux/slab.h>
#include <linux/interrupt.h>
#include <linux/pci.h>
#if LINUX_VERSION_CODE < 0x20155
#include <linux/bios32.h>
#endif
#include <linux/in.h>
#include <linux/if_arp.h>
#include <linux/netdevice.h>
......@@ -28,11 +24,8 @@
#include <asm/io.h>
#include <asm/dma.h>
#if LINUX_VERSION_CODE >= 0x20200
#include <asm/uaccess.h>
#endif
#include "lmc_ver.h"
#include "lmc.h"
#include "lmc_var.h"
#include "lmc_ioctl.h"
......
......@@ -19,7 +19,6 @@
* Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards.
*/
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/timer.h>
......@@ -46,7 +45,6 @@
#include <asm/dma.h>
#include <asm/smp.h>
#include "lmc_ver.h"
#include "lmc.h"
#include "lmc_var.h"
#include "lmc_debug.h"
......@@ -66,14 +64,6 @@
#define SPPP_attach(d) (void)0
#define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP
#else
#if LINUX_VERSION_CODE < 0x20363
#define SPPP_attach(x) sppp_attach((struct ppp_device *)(x)->lmc_device)
#define SPPP_detach(x) sppp_detach((x)->lmc_device)
#define SPPP_open(x) sppp_open((x)->lmc_device)
#define SPPP_reopen(x) sppp_reopen((x)->lmc_device)
#define SPPP_close(x) sppp_close((x)->lmc_device)
#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->lmc_device, (y), (z))
#else
#define SPPP_attach(x) sppp_attach((x)->pd)
#define SPPP_detach(x) sppp_detach((x)->pd->dev)
#define SPPP_open(x) sppp_open((x)->pd->dev)
......@@ -81,7 +71,6 @@
#define SPPP_close(x) sppp_close((x)->pd->dev)
#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z))
#endif
#endif
// init
void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
......@@ -89,15 +78,12 @@ void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
lmc_trace(sc->lmc_device, "lmc_proto_init in");
switch(sc->if_type){
case LMC_PPP:
#if LINUX_VERSION_CODE >= 0x20363
sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
if (!sc->pd) {
printk("lmc_proto_init(): kmalloc failure!\n");
return;
}
sc->pd->dev = sc->lmc_device;
#endif
sc->if_ptr = sc->pd;
break;
case LMC_RAW:
......
......@@ -48,9 +48,6 @@ typedef struct lmc___ctl lmc_ctl_t;
#define u_int16_t u16
#define u_int8_t u8
#define tulip_uint32_t u32
#if LINUX_VERSION_CODE < 0x20155
#define u_int32_t u32
#endif
#define LMC_REG_RANGE 0x80
......@@ -410,9 +407,7 @@ struct lmc___softc {
u32 last_int;
u32 num_int;
#if LINUX_VERSION_CODE >= 0x20200
spinlock_t lmc_lock;
#endif
u_int16_t if_type; /* PPP or NET */
struct ppp_device *pd;
......@@ -550,10 +545,6 @@ struct lmc___softc {
#define LMC_CRC_LEN_16 2 /* 16-bit CRC */
#define LMC_CRC_LEN_32 4
#if LINUX_VERSION_CODE < 0x20100
#define test_and_set_bit(val, addr) set_bit(val, addr)
#endif
#ifdef LMC_HDLC
/* definition of an hdlc header. */
struct hdlc_hdr
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment