Commit 24a17a26 authored by Linus Torvalds's avatar Linus Torvalds

Merge http://gkernel.bkbits.net/net-drivers-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents eadb448c 937d5b67
This diff is collapsed.
......@@ -417,7 +417,16 @@ struct cmd {
#define BD_FLG_TCP_UDP_SUM 0x01
#define BD_FLG_IP_SUM 0x02
#define BD_FLG_END 0x04
#define BD_FLG_MORE 0x08
#define BD_FLG_JUMBO 0x10
#define BD_FLG_UCAST 0x20
#define BD_FLG_MCAST 0x40
#define BD_FLG_BCAST 0x60
#define BD_FLG_TYP_MASK 0x60
#define BD_FLG_IP_FRAG 0x80
#define BD_FLG_IP_FRAG_END 0x100
#define BD_FLG_VLAN_TAG 0x200
#define BD_FLG_FRAME_ERROR 0x400
#define BD_FLG_COAL_NOW 0x800
#define BD_FLG_MINI 0x1000
......@@ -437,11 +446,12 @@ struct cmd {
/*
* TX ring
* TX ring - maximum TX ring entries for Tigon I's is 128
*/
#define TX_RING_ENTRIES 256
#define TX_RING_SIZE (TX_RING_ENTRIES * sizeof(struct tx_desc))
#define TX_RING_BASE 0x3800
#define MAX_TX_RING_ENTRIES 256
#define TIGON_I_TX_RING_ENTRIES 128
#define TX_RING_SIZE (MAX_TX_RING_ENTRIES * sizeof(struct tx_desc))
#define TX_RING_BASE 0x3800
struct tx_desc{
aceaddr addr;
......@@ -608,7 +618,7 @@ struct tx_ring_info {
*/
struct ace_skb
{
struct tx_ring_info tx_skbuff[TX_RING_ENTRIES];
struct tx_ring_info tx_skbuff[MAX_TX_RING_ENTRIES];
struct ring_info rx_std_skbuff[RX_STD_RING_ENTRIES];
struct ring_info rx_mini_skbuff[RX_MINI_RING_ENTRIES];
struct ring_info rx_jumbo_skbuff[RX_JUMBO_RING_ENTRIES];
......@@ -632,6 +642,10 @@ struct ace_private
struct ace_skb *skb;
dma_addr_t info_dma; /* 32/64 bit */
#if ACENIC_DO_VLAN
struct vlan_group *vlgrp;
#endif
int version, link;
int promisc, mcast_all;
......@@ -642,6 +656,7 @@ struct ace_private
u32 tx_prd;
volatile u32 tx_ret_csm;
struct timer_list timer;
int tx_ring_entries;
/*
* RX elements
......@@ -692,17 +707,17 @@ struct ace_private
#define TX_RESERVED MAX_SKB_FRAGS
static inline int tx_space (u32 csm, u32 prd)
static inline int tx_space (struct ace_private *ap, u32 csm, u32 prd)
{
return (csm - prd - 1) & (TX_RING_ENTRIES - 1);
return (csm - prd - 1) & (ACE_TX_RING_ENTRIES(ap) - 1);
}
#define tx_free(ap) tx_space((ap)->tx_ret_csm, (ap)->tx_prd)
#define tx_free(ap) tx_space((ap)->tx_ret_csm, (ap)->tx_prd, ap)
#if MAX_SKB_FRAGS
#define tx_ring_full(csm, prd) (tx_space(csm, prd) <= TX_RESERVED)
#define tx_ring_full(ap, csm, prd) (tx_space(ap, csm, prd) <= TX_RESERVED)
#else
#define tx_ring_full 0
#define tx_ring_full 0
#endif
......@@ -711,7 +726,7 @@ static inline void set_aceaddr(aceaddr *aa, dma_addr_t addr)
u64 baddr = (u64) addr;
aa->addrlo = baddr & 0xffffffff;
aa->addrhi = baddr >> 32;
mb();
wmb();
}
......@@ -758,5 +773,9 @@ static void ace_free_descriptors(struct net_device *dev);
static void ace_init_cleanup(struct net_device *dev);
static struct net_device_stats *ace_get_stats(struct net_device *dev);
static int read_eeprom_byte(struct net_device *dev, unsigned long offset);
#if ACENIC_DO_VLAN
static void ace_vlan_rx_register(struct net_device *dev, struct vlan_group *grp);
static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid);
#endif
#endif /* _ACENIC_H_ */
......@@ -836,6 +836,7 @@ set_rx_mode(struct net_device *dev)
i++, mclist = mclist->next)
set_bit(ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26,
mc_filter);
outb(0x02, ioaddr + RX_MODE); /* Use normal mode. */
}
save_flags(flags);
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......@@ -119,26 +118,16 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
* defaults as considerably less data will be queued.
*/
#define MAX_TCB 64 /* number of transmit control blocks */
#define MAX_TBD MAX_TCB
#define TX_FRAME_CNT 8 /* consecutive transmit frames per interrupt */
/* TX_FRAME_CNT must be less than MAX_TCB */
#define MAX_RFD 64
#define E100_DEFAULT_TCB MAX_TCB
#define E100_DEFAULT_TCB 64
#define E100_MIN_TCB 2*TX_FRAME_CNT + 3 /* make room for at least 2 interrupts */
#define E100_MAX_TCB 1024
#define E100_DEFAULT_RFD MAX_RFD
#define E100_DEFAULT_RFD 64
#define E100_MIN_RFD 8
#ifdef __ia64__
/* We can't use too many DMAble buffers on IA64 machines with >4 GB mem */
#define E100_MAX_RFD 64
#else
#define E100_MAX_RFD 1024
#endif /* __ia64__ */
#define E100_DEFAULT_XSUM true
#define E100_DEFAULT_BER ZLOCK_MAX_ERRORS
......@@ -149,10 +138,6 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define TX_THRSHLD 8
/* sleep time is at least 50 ms, in jiffies */
#define SLEEP_TIME ((HZ / 20) + 1)
#define CUS_TIMEOUT 1000
/* IFS parameters */
#define MIN_NUMBER_OF_TRANSMITS_100 1000
#define MIN_NUMBER_OF_TRANSMITS_10 100
......@@ -529,8 +514,6 @@ typedef struct net_device_stats net_dev_stats_t;
#define RFD_POINTER(skb,bdp) ((rfd_t *) (((unsigned char *)((skb)->data))-((bdp)->rfd_size)))
#define SKB_RFD_STATUS(skb,bdp) ((RFD_POINTER((skb),(bdp)))->rfd_header.cb_status)
#define GET_SKB_DMA_ADDR(skb) ( *(dma_addr_t *)( (skb)->cb) )
#define SET_SKB_DMA_ADDR(skb,dma_addr) ( *(dma_addr_t *)( (skb)->cb) = (dma_addr) )
/* ====================================================================== */
/* 82557 */
......@@ -1032,6 +1015,14 @@ extern unsigned char e100_selftest(struct e100_private *bdp, u32 *st_timeout,
extern unsigned char e100_get_link_state(struct e100_private *bdp);
extern unsigned char e100_wait_scb(struct e100_private *bdp);
#ifndef yield
#define yield() \
do { \
current->policy |= SCHED_YIELD; \
schedule(); \
} while (0)
#endif
extern void e100_deisolate_driver(struct e100_private *bdp,
u8 recover, u8 full_reset);
extern unsigned char e100_hw_reset_recover(struct e100_private *bdp,
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......@@ -138,7 +137,7 @@ eeprom_set_semaphore(struct e100_private *adapter)
u16 data = 0;
unsigned long expiration_time = jiffies + HZ / 100 + 1;
while (time_before(jiffies, expiration_time)) {
do {
// Get current value of General Control 2
data = readb(&CSR_GENERAL_CONTROL2_FIELD(adapter));
......@@ -155,10 +154,12 @@ eeprom_set_semaphore(struct e100_private *adapter)
return true;
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1+(HZ-1)/100);
}
return false;
if (time_before(jiffies, expiration_time))
yield();
else
return false;
} while (true);
}
//----------------------------------------------------------------------------------------
......@@ -580,17 +581,16 @@ eeprom_wait_cmd_done(struct e100_private *adapter)
eeprom_stand_by(adapter);
while (time_before(jiffies, expiration_time)) {
do {
rmb();
x = readw(&CSR_EEPROM_CONTROL_FIELD(adapter));
if (x & EEDO)
return true;
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1+(HZ-1)/100);
}
return false;
if (time_before(jiffies, expiration_time))
yield();
else
return false;
} while (true);
}
//----------------------------------------------------------------------------------------
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......@@ -166,7 +165,7 @@ static void e100_non_tx_background(unsigned long);
/* Global Data structures and variables */
char e100_copyright[] __devinitdata = "Copyright (c) 2002 Intel Corporation";
#define E100_VERSION "2.0.22-pre1"
#define E100_VERSION "2.0.24-pre1"
#define E100_FULL_DRIVER_NAME "Intel(R) PRO/100 Fast Ethernet Adapter - Loadable driver, ver "
......@@ -187,8 +186,7 @@ static int e100_resume(struct pci_dev *pcid);
* See the item "Labeled Elements in Initializers" in the section
* "Extensions to the C Language Family" of the GCC documentation.
*********************************************************************/
#define E100_PARAM_INIT { [0 ... E100_MAX_NIC-1] = -1 }
#define E100_PARAM_INIT { [0 ... E100_MAX_NIC] = -1 }
/* All parameters are treated the same, as an integer array of values.
* This macro just reduces the need to repeat the same declaration code
......@@ -543,6 +541,7 @@ static inline void
e100_set_intr_mask(struct e100_private *bdp)
{
writeb(bdp->intr_mask, &bdp->scb->scb_cmd_hi);
readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
}
static inline void
......@@ -802,79 +801,66 @@ module_exit(e100_cleanup_module);
void __devinit
e100_check_options(int board, struct e100_private *bdp)
{
int val;
if (board >= E100_MAX_NIC) {
printk(KERN_NOTICE "No configuration available for board #%d\n",
board);
printk(KERN_NOTICE "Using defaults for all values\n");
board = E100_MAX_NIC;
}
val = (board < E100_MAX_NIC) ? TxDescriptors[board] : -1;
e100_set_int_option(&(bdp->params.TxDescriptors), val, E100_MIN_TCB,
E100_MAX_TCB, E100_DEFAULT_TCB,
e100_set_int_option(&(bdp->params.TxDescriptors), TxDescriptors[board],
E100_MIN_TCB, E100_MAX_TCB, E100_DEFAULT_TCB,
"TxDescriptor count");
val = (board < E100_MAX_NIC) ? RxDescriptors[board] : -1;
e100_set_int_option(&(bdp->params.RxDescriptors), val, E100_MIN_RFD,
E100_MAX_RFD, E100_DEFAULT_RFD,
e100_set_int_option(&(bdp->params.RxDescriptors), RxDescriptors[board],
E100_MIN_RFD, E100_MAX_RFD, E100_DEFAULT_RFD,
"RxDescriptor count");
val = (board < E100_MAX_NIC) ? e100_speed_duplex[board] : -1;
e100_set_int_option(&(bdp->params.e100_speed_duplex), val, 0, 4,
e100_set_int_option(&(bdp->params.e100_speed_duplex),
e100_speed_duplex[board], 0, 4,
E100_DEFAULT_SPEED_DUPLEX, "speed/duplex mode");
val = (board < E100_MAX_NIC) ? ber[board] : -1;
e100_set_int_option(&(bdp->params.ber), val, 0, ZLOCK_MAX_ERRORS,
e100_set_int_option(&(bdp->params.ber), ber[board], 0, ZLOCK_MAX_ERRORS,
E100_DEFAULT_BER, "Bit Error Rate count");
val = (board < E100_MAX_NIC) ? XsumRX[board] : -1;
e100_set_bool_option(bdp, val, PRM_XSUMRX, E100_DEFAULT_XSUM,
e100_set_bool_option(bdp, XsumRX[board], PRM_XSUMRX, E100_DEFAULT_XSUM,
"XsumRX value");
/* Default ucode value depended on controller revision */
val = (board < E100_MAX_NIC) ? ucode[board] : -1;
if (bdp->rev_id >= D101MA_REV_ID) {
e100_set_bool_option(bdp, val, PRM_UCODE, E100_DEFAULT_UCODE,
"ucode value");
e100_set_bool_option(bdp, ucode[board], PRM_UCODE,
E100_DEFAULT_UCODE, "ucode value");
} else {
e100_set_bool_option(bdp, val, PRM_UCODE, false, "ucode value");
e100_set_bool_option(bdp, ucode[board], PRM_UCODE, false,
"ucode value");
}
val = (board < E100_MAX_NIC) ? flow_control[board] : -1;
e100_set_bool_option(bdp, val, PRM_FC, E100_DEFAULT_FC,
e100_set_bool_option(bdp, flow_control[board], PRM_FC, E100_DEFAULT_FC,
"flow control value");
val = (board < E100_MAX_NIC) ? IFS[board] : -1;
e100_set_bool_option(bdp, val, PRM_IFS, E100_DEFAULT_IFS, "IFS value");
e100_set_bool_option(bdp, IFS[board], PRM_IFS, E100_DEFAULT_IFS,
"IFS value");
val = (board < E100_MAX_NIC) ? BundleSmallFr[board] : -1;
e100_set_bool_option(bdp, val, PRM_BUNDLE_SMALL,
e100_set_bool_option(bdp, BundleSmallFr[board], PRM_BUNDLE_SMALL,
E100_DEFAULT_BUNDLE_SMALL_FR,
"CPU saver bundle small frames value");
val = (board < E100_MAX_NIC) ? IntDelay[board] : -1;
e100_set_int_option(&(bdp->params.IntDelay), val, 0x0, 0xFFFF,
E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY,
e100_set_int_option(&(bdp->params.IntDelay), IntDelay[board], 0x0,
0xFFFF, E100_DEFAULT_CPUSAVER_INTERRUPT_DELAY,
"CPU saver interrupt delay value");
val = (board < E100_MAX_NIC) ? BundleMax[board] : -1;
e100_set_int_option(&(bdp->params.BundleMax), val, 0x1, 0xFFFF,
E100_DEFAULT_CPUSAVER_BUNDLE_MAX,
e100_set_int_option(&(bdp->params.BundleMax), BundleMax[board], 0x1,
0xFFFF, E100_DEFAULT_CPUSAVER_BUNDLE_MAX,
"CPU saver bundle max value");
val = (board < E100_MAX_NIC) ? RxCongestionControl[board] : -1;
e100_set_bool_option(bdp, val, PRM_RX_CONG,
e100_set_bool_option(bdp, RxCongestionControl[board], PRM_RX_CONG,
E100_DEFAULT_RX_CONGESTION_CONTROL,
"Rx Congestion Control value");
val = (board < E100_MAX_NIC) ? PollingMaxWork[board] : -1;
e100_set_int_option(&(bdp->params.PollingMaxWork), val, 1, E100_MAX_RFD,
RxDescriptors[board], "Polling Max Work value");
if (val <= 0) {
bdp->params.b_params &= ~PRM_RX_CONG;
}
e100_set_int_option(&(bdp->params.PollingMaxWork),
PollingMaxWork[board], 1, E100_MAX_RFD,
bdp->params.RxDescriptors,
"Polling Max Work value");
}
/**
......@@ -2221,6 +2207,12 @@ e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
tcb = bdp->tcb_pool.data;
tcb += TCB_TO_USE(bdp->tcb_pool);
if (bdp->flags & USE_IPCB) {
tcb->tcbu.ipcb.ip_activation_high = IPCB_IP_ACTIVATION_DEFAULT;
tcb->tcbu.ipcb.ip_schedule &= ~IPCB_TCP_PACKET;
tcb->tcbu.ipcb.ip_schedule &= ~IPCB_TCPUDP_CHECKSUM_ENABLE;
}
tcb->tcb_hdr.cb_status = 0;
tcb->tcb_thrshld = bdp->tx_thld;
tcb->tcb_hdr.cb_cmd |= __constant_cpu_to_le16(CB_S_BIT);
......@@ -2261,15 +2253,6 @@ e100_prepare_xmit_buff(struct e100_private *bdp, struct sk_buff *skb)
*chksum = e100_pseudo_hdr_csum(ip);
}
} else {
if (bdp->flags & USE_IPCB) {
tcb->tcbu.ipcb.ip_activation_high =
IPCB_IP_ACTIVATION_DEFAULT;
tcb->tcbu.ipcb.ip_schedule &= ~IPCB_TCP_PACKET;
tcb->tcbu.ipcb.ip_schedule &=
~IPCB_TCPUDP_CHECKSUM_ENABLE;
}
}
if (!skb_shinfo(skb)->nr_frags) {
......@@ -2722,7 +2705,7 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
cb_header_t *ntcb_hdr;
unsigned long lock_flag;
unsigned long expiration_time;
unsigned char rc = false;
unsigned char rc = true;
ntcb_hdr = (cb_header_t *) command->non_tx_cmd; /* get hdr of non tcb cmd */
......@@ -2757,6 +2740,7 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
if (!e100_wait_exec_cmplx(bdp, command->dma_addr, SCB_CUC_START)) {
spin_unlock_irqrestore(&(bdp->bd_lock), lock_flag);
rc = false;
goto exit;
}
......@@ -2765,20 +2749,21 @@ e100_exec_non_cu_cmd(struct e100_private *bdp, nxmit_cb_entry_t *command)
/* now wait for completion of non-cu CB up to 20 msec */
expiration_time = jiffies + HZ / 50 + 1;
while (time_before(jiffies, expiration_time)) {
rmb();
if ((ntcb_hdr->cb_status &
rmb();
while (!(ntcb_hdr->cb_status &
__constant_cpu_to_le16(CB_STATUS_COMPLETE))) {
rc = true;
if (time_before(jiffies, expiration_time)) {
spin_unlock_bh(&(bdp->bd_non_tx_lock));
yield();
spin_lock_bh(&(bdp->bd_non_tx_lock));
} else {
rc = false;
goto exit;
}
spin_unlock_bh(&(bdp->bd_non_tx_lock));
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(1);
spin_lock_bh(&(bdp->bd_non_tx_lock));
rmb();
}
/* didn't get a C bit assume command failed */
exit:
e100_free_non_tx_cmd(bdp, command);
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......@@ -654,7 +653,7 @@ static void
e100_force_speed_duplex(struct e100_private *bdp)
{
u16 control;
int neg_timeout = 2 * HZ; //2 sec in jiffies
unsigned long expires;
bdp->flags |= DF_SPEED_FORCED;
......@@ -697,20 +696,18 @@ e100_force_speed_duplex(struct e100_private *bdp)
e100_mdi_write(bdp, MII_BMCR, bdp->phy_addr, control);
/* loop must run at least once */
expires = jiffies + 2 * HZ;
do {
spin_unlock_bh(&(bdp->mdi_access_lock));
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(SLEEP_TIME);
spin_lock_bh(&(bdp->mdi_access_lock));
if (e100_update_link_state(bdp)) {
if (e100_update_link_state(bdp) ||
time_after(jiffies, expires)) {
break;
} else {
spin_unlock_bh(&(bdp->mdi_access_lock));
yield();
spin_lock_bh(&(bdp->mdi_access_lock));
}
neg_timeout -= SLEEP_TIME;
} while (neg_timeout > 0);
} while (true);
spin_unlock_bh(&(bdp->mdi_access_lock));
}
......@@ -820,7 +817,7 @@ static void
e100_auto_neg(struct e100_private *bdp, unsigned char force_restart)
{
u16 stat_reg;
unsigned int i;
unsigned long expires;
bdp->flags &= ~DF_SPEED_FORCED;
......@@ -841,22 +838,21 @@ e100_auto_neg(struct e100_private *bdp, unsigned char force_restart)
BMCR_ANENABLE | BMCR_ANRESTART);
/* wait for autoneg to complete (up to 3 seconds) */
for (i = 0; i < 60; i++) {
expires = jiffies + HZ * 3;
do {
/* now re-read the value. Sticky so read twice */
e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
e100_mdi_read(bdp, MII_BMSR, bdp->phy_addr, &stat_reg);
if (stat_reg & BMSR_ANEGCOMPLETE)
if ((stat_reg & BMSR_ANEGCOMPLETE) ||
time_after(jiffies, expires) ) {
goto exit;
spin_unlock_bh(&(bdp->mdi_access_lock));
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(SLEEP_TIME);
spin_lock_bh(&(bdp->mdi_access_lock));
}
} else {
spin_unlock_bh(&(bdp->mdi_access_lock));
yield();
spin_lock_bh(&(bdp->mdi_access_lock));
}
} while (true);
}
exit:
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......@@ -98,7 +97,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef E100_CONFIG_PROC_FS
#include "e100.h"
/* MDI sleep time is at least 50 ms, in jiffies */
#define MDI_SLEEP_TIME ((HZ / 20) + 1)
/***************************************************************************/
/* /proc File System Interaface Support Functions */
/***************************************************************************/
......@@ -231,7 +231,7 @@ set_led(struct e100_private *bdp, u16 led_mdi_op)
spin_unlock_bh(&bdp->mdi_access_lock);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(SLEEP_TIME);
schedule_timeout(MDI_SLEEP_TIME);
spin_lock_bh(&bdp->mdi_access_lock);
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......
......@@ -2,9 +2,8 @@
This software program is available to you under a choice of one of two
licenses. You may choose to be licensed under either the GNU General Public
License (GPL) Version 2, June 1991, available at
http://www.fsf.org/copyleft/gpl.html, or the Intel BSD + Patent License, the
text of which follows:
License 2.0, June 1991, available at http://www.fsf.org/copyleft/gpl.html,
or the Intel BSD + Patent License, the text of which follows:
Recipient has requested a license and Intel Corporation ("Intel") is willing
to grant a license for the software entitled Linux Base Driver for the
......@@ -18,7 +17,7 @@ combined with the operating system referred to below.
"Recipient" means the party to whom Intel delivers this Software.
"Licensee" means Recipient and those third parties that receive a license to
any operating system available under the GNU Public License version 2.0 or
any operating system available under the GNU General Public License 2.0 or
later.
Copyright (c) 1999 - 2002 Intel Corporation.
......@@ -51,10 +50,10 @@ not add functionality or features when the Software is incorporated in any
version of an operating system that has been distributed under the GNU
General Public License 2.0 or later. This patent license shall apply to the
combination of the Software and any operating system licensed under the GNU
Public License version 2.0 or later if, at the time Intel provides the
General Public License 2.0 or later if, at the time Intel provides the
Software to Recipient, such addition of the Software to the then publicly
available versions of such operating systems available under the GNU Public
License version 2.0 or later (whether in gold, beta or alpha form) causes
available versions of such operating systems available under the GNU General
Public License 2.0 or later (whether in gold, beta or alpha form) causes
such combination to be covered by the Licensed Patents. The patent license
shall not apply to any other combinations which include the Software. NO
hardware per se is licensed hereunder.
......
......@@ -183,7 +183,7 @@ static struct pci_driver e1000_driver = {
name: e1000_driver_name,
id_table: e1000_pci_tbl,
probe: e1000_probe,
remove: e1000_remove,
remove: __devexit_p(e1000_remove),
/* Power Managment Hooks */
suspend: NULL,
resume: NULL
......
......@@ -114,7 +114,6 @@ static int debug = -1; /* The debug level */
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
MODULE_AUTHOR("Maintainer: Andrey V. Savochkin <saw@saw.sw.com.sg>");
MODULE_DESCRIPTION("Intel i82557/i82558/i82559 PCI EtherExpressPro driver");
......
......@@ -83,8 +83,6 @@
**
*/
#error Please convert me to Documentation/DMA-mapping.txt
#define HP100_DEFAULT_PRIORITY_TX 0
#undef HP100_DEBUG
......@@ -212,8 +210,8 @@ struct hp100_private {
hp100_ring_t rxring[MAX_RX_PDL];
hp100_ring_t txring[MAX_TX_PDL];
u_int *page_vaddr; /* Virtual address of allocated page */
u_int *page_vaddr_algn; /* Aligned virtual address of allocated page */
u_long whatever_offset; /* Offset to bus/phys/dma address */
int rxrcommit; /* # Rx PDLs commited to adapter */
int txrcommit; /* # Tx PDLs commited to adapter */
};
......@@ -350,6 +348,18 @@ static void hp100_clean_txring(struct net_device *dev);
static void hp100_RegisterDump(struct net_device *dev);
#endif
/* Conversion to new PCI API :
* Convert an address in a kernel buffer to a bus/phys/dma address.
* This work *only* for memory fragments part of lp->page_vaddr,
* because it was properly DMA allocated via pci_alloc_consistent(),
* so we just need to "retreive" the original mapping to bus/phys/dma
* address - Jean II */
static inline dma_addr_t virt_to_whatever(struct net_device *dev, u32 * ptr)
{
return ((u_long) ptr) +
((struct hp100_private *) (dev->priv))->whatever_offset;
}
/* TODO: This function should not really be needed in a good design... */
static void wait(void)
{
......@@ -627,9 +637,20 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
local_mode = 3;
} else if (chip == HP100_CHIPID_LASSEN &&
(lsw & (HP100_BM_WRITE | HP100_BM_READ)) == (HP100_BM_WRITE | HP100_BM_READ)) {
/* Conversion to new PCI API :
* I don't have the doc, but I assume that the card
* can map the full 32bit address space.
* Also, we can have EISA Busmaster cards (not tested),
* so beware !!! - Jean II */
if((bus == HP100_BUS_PCI) &&
(pci_set_dma_mask(pci_dev, 0xffffffff))) {
/* Gracefully fallback to shared memory */
goto busmasterfail;
}
printk("hp100: %s: Busmaster mode enabled.\n", dev->name);
hp100_outw(HP100_MEM_EN | HP100_IO_EN | HP100_RESET_LB, OPTION_LSW);
} else {
busmasterfail:
#ifdef HP100_DEBUG
printk("hp100: %s: Card not configured for BM or BM not supported with this card.\n", dev->name);
printk("hp100: %s: Trying shared memory mode.\n", dev->name);
......@@ -772,11 +793,14 @@ static int __init hp100_probe1(struct net_device *dev, int ioaddr,
* in the cards shared memory area. But currently, busmaster has been
* implemented/tested only with the lassen chip anyway... */
if (lp->mode == 1) { /* busmaster */
dma_addr_t page_baddr;
/* Get physically continous memory for TX & RX PDLs */
if ((lp->page_vaddr = kmalloc(MAX_RINGSIZE + 0x0f, GFP_KERNEL)) == NULL)
/* Conversion to new PCI API :
* Pages are always aligned and zeroed, no need to it ourself.
* Doc says should be OK for EISA bus as well - Jean II */
if ((lp->page_vaddr_algn = pci_alloc_consistent(lp->pci_dev, MAX_RINGSIZE, &page_baddr)) == NULL)
return -ENOMEM;
lp->page_vaddr_algn = ((u_int *) (((u_int) (lp->page_vaddr) + 0x0f) & ~0x0f));
memset(lp->page_vaddr, 0, MAX_RINGSIZE + 0x0f);
lp->whatever_offset = ((u_long) page_baddr) - ((u_long) lp->page_vaddr_algn);
#ifdef HP100_DEBUG_BM
printk("hp100: %s: Reserved DMA memory from 0x%x to 0x%x\n", dev->name, (u_int) lp->page_vaddr_algn, (u_int) lp->page_vaddr_algn + MAX_RINGSIZE);
......@@ -1189,7 +1213,7 @@ static void hp100_init_pdls(struct net_device *dev)
{
struct hp100_private *lp = (struct hp100_private *) dev->priv;
hp100_ring_t *ringptr;
u_int *pageptr;
u_int *pageptr; /* Warning : increment by 4 - Jean II */
int i;
#ifdef HP100_DEBUG_B
......@@ -1246,7 +1270,7 @@ static int hp100_init_rxpdl(struct net_device *dev,
dev->name, (unsigned) pdlptr);
ringptr->pdl = pdlptr + 1;
ringptr->pdl_paddr = virt_to_bus(pdlptr + 1);
ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr + 1);
ringptr->skb = (void *) NULL;
/*
......@@ -1257,7 +1281,7 @@ static int hp100_init_rxpdl(struct net_device *dev,
*/
/* Note that pdlptr+1 and not pdlptr is the pointer to the PDH */
*(pdlptr + 2) = (u_int) virt_to_bus(pdlptr); /* Address Frag 1 */
*(pdlptr + 2) = (u_int) virt_to_whatever(dev, pdlptr); /* Address Frag 1 */
*(pdlptr + 3) = 4; /* Length Frag 1 */
return ((((MAX_RX_FRAG * 2 + 2) + 3) / 4) * 4);
......@@ -1272,7 +1296,7 @@ static int hp100_init_txpdl(struct net_device *dev,
printk("hp100: %s: Init txpdl: Unaligned pdlptr 0x%x.\n", dev->name, (unsigned) pdlptr);
ringptr->pdl = pdlptr; /* +1; */
ringptr->pdl_paddr = virt_to_bus(pdlptr); /* +1 */
ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr); /* +1 */
ringptr->skb = (void *) NULL;
return ((((MAX_TX_FRAG * 2 + 2) + 3) / 4) * 4);
......@@ -1331,8 +1355,10 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
(unsigned int) ringptr->skb->data);
#endif
/* Conversion to new PCI API : map skbuf data to PCI bus.
* Doc says it's OK for EISA as well - Jean II */
ringptr->pdl[0] = 0x00020000; /* Write PDH */
ringptr->pdl[3] = ((u_int) virt_to_bus(ringptr->skb->data));
ringptr->pdl[3] = ((u_int) pci_map_single(((struct hp100_private *) (dev->priv))->pci_dev, ringptr->skb->data, MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE));
ringptr->pdl[4] = MAX_ETHER_SIZE; /* Length of Data */
#ifdef HP100_DEBUG_BM
......@@ -1585,7 +1611,6 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
ringptr->skb = skb;
ringptr->pdl[0] = ((1 << 16) | i); /* PDH: 1 Fragment & length */
ringptr->pdl[1] = (u32) virt_to_bus(skb->data); /* 1st Frag: Adr. of data */
if (lp->chip == HP100_CHIPID_SHASTA) {
/* TODO:Could someone who has the EISA card please check if this works? */
ringptr->pdl[2] = i;
......@@ -1593,6 +1618,9 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
/* In the PDL, don't use the padded size but the real packet size: */
ringptr->pdl[2] = skb->len; /* 1st Frag: Length of frag */
}
/* Conversion to new PCI API : map skbuf data to PCI bus.
* Doc says it's OK for EISA as well - Jean II */
ringptr->pdl[1] = ((u32) pci_map_single(lp->pci_dev, skb->data, ringptr->pdl[2], PCI_DMA_TODEVICE)); /* 1st Frag: Adr. of data */
/* Hand this PDL to the card. */
hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */
......@@ -1641,6 +1669,8 @@ static void hp100_clean_txring(struct net_device *dev)
dev->name, (u_int) lp->txrhead->skb->data,
lp->txrcommit, hp100_inb(TX_PDL), donecount);
#endif
/* Conversion to new PCI API : NOP */
pci_unmap_single(lp->pci_dev, (dma_addr_t) lp->txrhead->pdl[1], lp->txrhead->pdl[2], PCI_DMA_TODEVICE);
dev_kfree_skb_any(lp->txrhead->skb);
lp->txrhead->skb = (void *) NULL;
lp->txrhead = lp->txrhead->next;
......@@ -1950,6 +1980,9 @@ static void hp100_rx_bm(struct net_device *dev)
header = *(ptr->pdl - 1);
pkt_len = (header & HP100_PKT_LEN_MASK);
/* Conversion to new PCI API : NOP */
pci_unmap_single(lp->pci_dev, (dma_addr_t) ptr->pdl[3], MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE);
#ifdef HP100_DEBUG_BM
printk("hp100: %s: rx_bm: header@0x%x=0x%x length=%d, errors=0x%x, dest=0x%x\n",
dev->name, (u_int) (ptr->pdl - 1), (u_int) header,
......@@ -2910,7 +2943,7 @@ static void release_dev(int i)
release_region(d->base_addr, HP100_REGION_SIZE);
if (p->mode == 1) /* busmaster */
kfree(p->page_vaddr);
pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f, p->page_vaddr_algn, virt_to_whatever(d, p->page_vaddr_algn));
if (p->mem_ptr_virt)
iounmap(p->mem_ptr_virt);
kfree(d->priv);
......
......@@ -354,7 +354,7 @@ MODULE_LICENSE("GPL");
board probes now that kmalloc() can allocate ISA DMA-able regions.
This also allows the LANCE driver to be used as a module.
*/
int lance_probe(struct net_device *dev)
int __init lance_probe(struct net_device *dev)
{
int *port, result;
......
This diff is collapsed.
......@@ -323,7 +323,7 @@ struct pcnet32_private {
static void pcnet32_probe_vlbus(void);
static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
static int pcnet32_probe1(unsigned long, unsigned char, int, struct pci_dev *);
static int pcnet32_probe1(unsigned long, unsigned int, int, struct pci_dev *);
static int pcnet32_open(struct net_device *);
static int pcnet32_init_ring(struct net_device *);
static int pcnet32_start_xmit(struct sk_buff *, struct net_device *);
......@@ -507,7 +507,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
* pdev will be NULL when called from pcnet32_probe_vlbus.
*/
static int __devinit
pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
struct pci_dev *pdev)
{
struct pcnet32_private *lp;
......@@ -522,13 +522,13 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
u8 promaddr[6];
/* reset the chip */
pcnet32_dwio_reset(ioaddr);
pcnet32_wio_reset(ioaddr);
/* NOTE: 16-bit check is first, otherwise some older PCnet chips fail */
if (pcnet32_wio_read_csr(ioaddr, 0) == 4 && pcnet32_wio_check(ioaddr)) {
a = &pcnet32_wio;
} else {
pcnet32_dwio_reset(ioaddr);
if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 && pcnet32_dwio_check(ioaddr)) {
a = &pcnet32_dwio;
} else
......@@ -789,7 +789,7 @@ pcnet32_probe1(unsigned long ioaddr, unsigned char irq_line, int shared,
dev->set_multicast_list = &pcnet32_set_multicast_list;
dev->do_ioctl = &pcnet32_ioctl;
dev->tx_timeout = pcnet32_tx_timeout;
dev->watchdog_timeo = (HZ >> 1);
dev->watchdog_timeo = (5*HZ);
lp->next = pcnet32_dev;
pcnet32_dev = dev;
......@@ -946,7 +946,7 @@ pcnet32_purge_tx_ring(struct net_device *dev)
for (i = 0; i < TX_RING_SIZE; i++) {
if (lp->tx_skbuff[i]) {
pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
dev_kfree_skb(lp->tx_skbuff[i]);
dev_kfree_skb_any(lp->tx_skbuff[i]);
lp->tx_skbuff[i] = NULL;
lp->tx_dma_addr[i] = 0;
}
......@@ -1022,8 +1022,9 @@ static void
pcnet32_tx_timeout (struct net_device *dev)
{
struct pcnet32_private *lp = dev->priv;
unsigned int ioaddr = dev->base_addr;
unsigned long ioaddr = dev->base_addr, flags;
spin_lock_irqsave(&lp->lock, flags);
/* Transmitter timeout, serious problems. */
printk(KERN_ERR "%s: transmit timed out, status %4.4x, resetting.\n",
dev->name, lp->a.read_csr(ioaddr, 0));
......@@ -1048,6 +1049,8 @@ pcnet32_tx_timeout (struct net_device *dev)
dev->trans_start = jiffies;
netif_start_queue(dev);
spin_unlock_irqrestore(&lp->lock, flags);
}
......@@ -1055,7 +1058,7 @@ static int
pcnet32_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct pcnet32_private *lp = dev->priv;
unsigned int ioaddr = dev->base_addr;
unsigned long ioaddr = dev->base_addr;
u16 status;
int entry;
unsigned long flags;
......@@ -1307,6 +1310,7 @@ pcnet32_rx(struct net_device *dev)
if ((newskb = dev_alloc_skb (PKT_BUF_SZ))) {
skb_reserve (newskb, 2);
skb = lp->rx_skbuff[entry];
pci_unmap_single(lp->pci_dev, lp->rx_dma_addr[entry], skb->len, PCI_DMA_FROMDEVICE);
skb_put (skb, pkt_len);
lp->rx_skbuff[entry] = newskb;
newskb->dev = dev;
......@@ -1473,9 +1477,10 @@ static void pcnet32_load_multicast (struct net_device *dev)
*/
static void pcnet32_set_multicast_list(struct net_device *dev)
{
unsigned long ioaddr = dev->base_addr;
unsigned long ioaddr = dev->base_addr, flags;
struct pcnet32_private *lp = dev->priv;
spin_lock_irqsave(&lp->lock, flags);
if (dev->flags&IFF_PROMISC) {
/* Log any net taps. */
printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
......@@ -1488,6 +1493,7 @@ static void pcnet32_set_multicast_list(struct net_device *dev)
lp->a.write_csr (ioaddr, 0, 0x0004); /* Temporarily stop the lance. */
pcnet32_restart(dev, 0x0042); /* Resume normal operation */
spin_unlock_irqrestore(&lp->lock, flags);
}
static int mdio_read(struct net_device *dev, int phy_id, int reg_num)
......
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