Commit 96b7bd95 authored by Paul Mackerras's avatar Paul Mackerras

Merge samba.org:/stuff/paulus/kernel/linux-2.5

into samba.org:/stuff/paulus/kernel/for-linus-ppc
parents a137b10b 57bd7464
...@@ -721,7 +721,7 @@ static void __attach_bond_to_agg(struct port *port) ...@@ -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 * @port: the port we're looking at
* *
* Handle the detaching of the port's control parser/multiplexer from the * 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) ...@@ -828,6 +828,55 @@ static struct aggregator *__get_active_agg(struct aggregator *aggregator)
return retval; 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 ====================================== // ================= main 802.3ad protocol code ======================================
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
...@@ -1177,43 +1226,11 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port) ...@@ -1177,43 +1226,11 @@ static void ad_rx_machine(struct lacpdu *lacpdu, struct port *port)
*/ */
static void ad_tx_machine(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 // 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)) { if (port->sm_tx_timer_counter && !(--port->sm_tx_timer_counter)) {
// check if there is something to send // check if there is something to send
if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) { if (port->ntt && (port->sm_vars & AD_PORT_LACP_ENABLED)) {
//update current actual Actor parameters __update_lacpdu_from_port(port);
//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);
// send the lacpdu // send the lacpdu
if (ad_lacpdu_send(port) >= 0) { if (ad_lacpdu_send(port) >= 0) {
BOND_PRINT_DBG(("Sent LACPDU on port %d", port->actor_port_number)); BOND_PRINT_DBG(("Sent LACPDU on port %d", port->actor_port_number));
...@@ -1971,13 +1988,13 @@ void bond_3ad_unbind_slave(struct slave *slave) ...@@ -1971,13 +1988,13 @@ void bond_3ad_unbind_slave(struct slave *slave)
return; return;
} }
// disable the port BOND_PRINT_DBG(("Unbinding Link Aggregation Group %d", aggregator->aggregator_identifier));
ad_disable_collecting_distributing(port);
// deinitialize port's locks if necessary(os-specific) /* Tell the partner that this port is not suitable for aggregation */
__deinitialize_port_locks(port); 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 // check if this aggregator is occupied
if (aggregator->lag_ports) { if (aggregator->lag_ports) {
// check if there are other ports related to this aggregator except // check if there are other ports related to this aggregator except
......
...@@ -2220,7 +2220,7 @@ static void bond_mii_monitor(struct net_device *master) ...@@ -2220,7 +2220,7 @@ static void bond_mii_monitor(struct net_device *master)
} }
printk(KERN_INFO printk(KERN_INFO
"%s: link status definitely down " "%s: link status definitely down "
"for interface %s, disabling it\n", "for interface %s, disabling it",
master->name, master->name,
dev->name); dev->name);
...@@ -2994,6 +2994,7 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd) ...@@ -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 ifbond *u_binfo = NULL, k_binfo;
struct ifslave *u_sinfo = NULL, k_sinfo; struct ifslave *u_sinfo = NULL, k_sinfo;
struct mii_ioctl_data *mii = NULL; struct mii_ioctl_data *mii = NULL;
int prev_abi_ver = orig_app_abi_ver;
int ret = 0; int ret = 0;
#ifdef BONDING_DEBUG #ifdef BONDING_DEBUG
...@@ -3112,6 +3113,15 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd) ...@@ -3112,6 +3113,15 @@ static int bond_ioctl(struct net_device *master_dev, struct ifreq *ifr, int cmd)
} }
dev_put(slave_dev); 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; return ret;
} }
......
...@@ -1715,7 +1715,7 @@ static int autodetect; ...@@ -1715,7 +1715,7 @@ static int autodetect;
static int n_eepro; static int n_eepro;
/* For linux 2.1.xx */ /* 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_DESCRIPTION("Intel i82595 ISA EtherExpressPro10/10+ driver");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
......
...@@ -84,11 +84,14 @@ ...@@ -84,11 +84,14 @@
- Fix bug of custom mac address - Fix bug of custom mac address
(StationAddr register only accept word write) (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_NAME "sundance"
#define DRV_VERSION "1.01+LK1.08a" #define DRV_VERSION "1.01+LK1.09a"
#define DRV_RELDATE "23-Apr-2003" #define DRV_RELDATE "16-May-2003"
/* The user-configurable values. /* The user-configurable values.
...@@ -671,8 +674,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, ...@@ -671,8 +674,8 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
np->an_enable = 1; np->an_enable = 1;
} }
} }
if (flowctrl == 0) if (flowctrl == 1)
np->flowctrl = 0; np->flowctrl = 1;
} }
/* Fibre PHY? */ /* Fibre PHY? */
...@@ -687,6 +690,9 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, ...@@ -687,6 +690,9 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
/* Reset PHY */ /* Reset PHY */
mdio_write (dev, np->phys[0], MII_BMCR, BMCR_RESET); mdio_write (dev, np->phys[0], MII_BMCR, BMCR_RESET);
mdelay (300); 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); mdio_write (dev, np->phys[0], MII_BMCR, BMCR_ANENABLE|BMCR_ANRESTART);
/* Force media type */ /* Force media type */
if (!np->an_enable) { if (!np->an_enable) {
...@@ -935,7 +941,7 @@ static void check_duplex(struct net_device *dev) ...@@ -935,7 +941,7 @@ static void check_duplex(struct net_device *dev)
printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d " printk(KERN_INFO "%s: Setting %s-duplex based on MII #%d "
"negotiated capability %4.4x.\n", dev->name, "negotiated capability %4.4x.\n", dev->name,
duplex ? "full" : "half", np->phys[0], negotiated); 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) ...@@ -1455,9 +1461,12 @@ static void netdev_error(struct net_device *dev, int intr_status)
"full" : "half"); "full" : "half");
} }
check_duplex (dev); check_duplex (dev);
if (np->flowctrl == 0) if (np->flowctrl && np->mii_if.full_duplex) {
writew(readw(ioaddr + MACCtrl0) & ~EnbFlowCtrl, writew(readw(ioaddr + MulticastFilter1+2) | 0x0200,
ioaddr + MulticastFilter1+2);
writew(readw(ioaddr + MACCtrl0) | EnbFlowCtrl,
ioaddr + MACCtrl0); ioaddr + MACCtrl0);
}
} }
if (intr_status & StatsMax) { if (intr_status & StatsMax) {
get_stats(dev); get_stats(dev);
...@@ -1500,6 +1509,7 @@ static struct net_device_stats *get_stats(struct net_device *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) static void set_rx_mode(struct net_device *dev)
{ {
long ioaddr = dev->base_addr; long ioaddr = dev->base_addr;
struct netdev_private *np = dev->priv;
u16 mc_filter[4]; /* Multicast hash filter */ u16 mc_filter[4]; /* Multicast hash filter */
u32 rx_mode; u32 rx_mode;
int i; int i;
...@@ -1532,6 +1542,9 @@ static void set_rx_mode(struct net_device *dev) ...@@ -1532,6 +1542,9 @@ static void set_rx_mode(struct net_device *dev)
writeb(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode); writeb(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode);
return; return;
} }
if (np->mii_if.full_duplex && np->flowctrl)
mc_filter[3] |= 0x0200;
for (i = 0; i < 4; i++) for (i = 0; i < 4; i++)
writew(mc_filter[i], ioaddr + MulticastFilter0 + i*2); writew(mc_filter[i], ioaddr + MulticastFilter0 + i*2);
writeb(rx_mode, ioaddr + RxMode); writeb(rx_mode, ioaddr + RxMode);
......
...@@ -2,9 +2,7 @@ ...@@ -2,9 +2,7 @@
#include <linux/types.h> #include <linux/types.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/version.h>
#include "lmc_ver.h"
#include "lmc_debug.h" #include "lmc_debug.h"
/* /*
......
This diff is collapsed.
/* $Id: lmc_media.c,v 1.13 2000/04/11 05:25:26 asj Exp $ */ /* $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/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -11,9 +10,6 @@ ...@@ -11,9 +10,6 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/pci.h> #include <linux/pci.h>
#if LINUX_VERSION_CODE < 0x20155
#include <linux/bios32.h>
#endif
#include <linux/in.h> #include <linux/in.h>
#include <linux/if_arp.h> #include <linux/if_arp.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
...@@ -28,11 +24,8 @@ ...@@ -28,11 +24,8 @@
#include <asm/io.h> #include <asm/io.h>
#include <asm/dma.h> #include <asm/dma.h>
#if LINUX_VERSION_CODE >= 0x20200
#include <asm/uaccess.h> #include <asm/uaccess.h>
#endif
#include "lmc_ver.h"
#include "lmc.h" #include "lmc.h"
#include "lmc_var.h" #include "lmc_var.h"
#include "lmc_ioctl.h" #include "lmc_ioctl.h"
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards. * Driver for the LanMedia LMC5200, LMC5245, LMC1000, LMC1200 cards.
*/ */
#include <linux/version.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/timer.h> #include <linux/timer.h>
...@@ -46,7 +45,6 @@ ...@@ -46,7 +45,6 @@
#include <asm/dma.h> #include <asm/dma.h>
#include <asm/smp.h> #include <asm/smp.h>
#include "lmc_ver.h"
#include "lmc.h" #include "lmc.h"
#include "lmc_var.h" #include "lmc_var.h"
#include "lmc_debug.h" #include "lmc_debug.h"
...@@ -66,14 +64,6 @@ ...@@ -66,14 +64,6 @@
#define SPPP_attach(d) (void)0 #define SPPP_attach(d) (void)0
#define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP #define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP
#else #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_attach(x) sppp_attach((x)->pd)
#define SPPP_detach(x) sppp_detach((x)->pd->dev) #define SPPP_detach(x) sppp_detach((x)->pd->dev)
#define SPPP_open(x) sppp_open((x)->pd->dev) #define SPPP_open(x) sppp_open((x)->pd->dev)
...@@ -81,7 +71,6 @@ ...@@ -81,7 +71,6 @@
#define SPPP_close(x) sppp_close((x)->pd->dev) #define SPPP_close(x) sppp_close((x)->pd->dev)
#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z)) #define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->pd->dev, (y), (z))
#endif #endif
#endif
// init // init
void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/ void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
...@@ -89,15 +78,12 @@ 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"); lmc_trace(sc->lmc_device, "lmc_proto_init in");
switch(sc->if_type){ switch(sc->if_type){
case LMC_PPP: case LMC_PPP:
#if LINUX_VERSION_CODE >= 0x20363
sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
if (!sc->pd) { if (!sc->pd) {
printk("lmc_proto_init(): kmalloc failure!\n"); printk("lmc_proto_init(): kmalloc failure!\n");
return; return;
} }
sc->pd->dev = sc->lmc_device; sc->pd->dev = sc->lmc_device;
#endif
sc->if_ptr = sc->pd; sc->if_ptr = sc->pd;
break; break;
case LMC_RAW: case LMC_RAW:
......
...@@ -48,9 +48,6 @@ typedef struct lmc___ctl lmc_ctl_t; ...@@ -48,9 +48,6 @@ typedef struct lmc___ctl lmc_ctl_t;
#define u_int16_t u16 #define u_int16_t u16
#define u_int8_t u8 #define u_int8_t u8
#define tulip_uint32_t u32 #define tulip_uint32_t u32
#if LINUX_VERSION_CODE < 0x20155
#define u_int32_t u32
#endif
#define LMC_REG_RANGE 0x80 #define LMC_REG_RANGE 0x80
...@@ -410,9 +407,7 @@ struct lmc___softc { ...@@ -410,9 +407,7 @@ struct lmc___softc {
u32 last_int; u32 last_int;
u32 num_int; u32 num_int;
#if LINUX_VERSION_CODE >= 0x20200
spinlock_t lmc_lock; spinlock_t lmc_lock;
#endif
u_int16_t if_type; /* PPP or NET */ u_int16_t if_type; /* PPP or NET */
struct ppp_device *pd; struct ppp_device *pd;
...@@ -550,10 +545,6 @@ struct lmc___softc { ...@@ -550,10 +545,6 @@ struct lmc___softc {
#define LMC_CRC_LEN_16 2 /* 16-bit CRC */ #define LMC_CRC_LEN_16 2 /* 16-bit CRC */
#define LMC_CRC_LEN_32 4 #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 #ifdef LMC_HDLC
/* definition of an hdlc header. */ /* definition of an hdlc header. */
struct hdlc_hdr 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