Commit e36a9e24 authored by Linus Torvalds's avatar Linus Torvalds

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

into home.osdl.org:/home/torvalds/v2.5/linux
parents e56b865f e40cca9e
......@@ -2475,10 +2475,11 @@ static int rtl8139_suspend (struct pci_dev *pdev, u32 state)
tp->stats.rx_missed_errors += RTL_R32 (RxMissed);
RTL_W32 (RxMissed, 0);
spin_unlock_irqrestore (&tp->lock, flags);
pci_set_power_state (pdev, 3);
pci_save_state (pdev, tp->pci_state);
spin_unlock_irqrestore (&tp->lock, flags);
return 0;
}
......
......@@ -60,7 +60,7 @@ static const u8 def_config[] = {
* All other init functions will only set values that are
* different from the 82557 default.
*/
void __devinit
void
e100_config_init_82557(struct e100_private *bdp)
{
/* initialize config block */
......@@ -104,7 +104,7 @@ e100_config_init_82557(struct e100_private *bdp)
e100_config_mulcast_enbl(bdp, false);
}
static void __devinit
static void
e100_config_init_82558(struct e100_private *bdp)
{
/* MWI enable. This should be turned on only if the adapter is a 82558/9
......@@ -136,7 +136,7 @@ e100_config_init_82558(struct e100_private *bdp)
e100_config_long_rx(bdp, true);
}
static void __devinit
static void
e100_config_init_82550(struct e100_private *bdp)
{
/* The D102 chip allows for 32 config bytes. This value is
......@@ -160,7 +160,7 @@ e100_config_init_82550(struct e100_private *bdp)
}
/* Initialize the adapter's configure block */
void __devinit
void
e100_config_init(struct e100_private *bdp)
{
e100_config_init_82557(bdp);
......
......@@ -124,7 +124,7 @@ static void e100_free_nontx_list(struct e100_private *);
static void e100_non_tx_background(unsigned long);
static inline void e100_tx_skb_free(struct e100_private *bdp, tcb_t *tcb);
/* Global Data structures and variables */
char e100_copyright[] __devinitdata = "Copyright (c) 2003 Intel Corporation";
char e100_copyright[] = "Copyright (c) 2003 Intel Corporation";
char e100_driver_version[]="2.3.30-k1";
const char *e100_full_driver_name = "Intel(R) PRO/100 Network Driver";
char e100_short_driver_name[] = "e100";
......@@ -539,7 +539,7 @@ e100_trigger_SWI(struct e100_private *bdp)
readw(&(bdp->scb->scb_status)); /* flushes last write, read-safe */
}
static int __devinit
static int
e100_found1(struct pci_dev *pcid, const struct pci_device_id *ent)
{
static int first_time = true;
......@@ -823,7 +823,7 @@ module_exit(e100_cleanup_module);
*
* This routine does range checking on command-line options
*/
void __devinit
void
e100_check_options(int board, struct e100_private *bdp)
{
if (board >= E100_MAX_NIC) {
......@@ -894,7 +894,7 @@ e100_check_options(int board, struct e100_private *bdp)
* If the option's value is '-1' use the specified default.
* Otherwise, if the value is invalid, change it to the default.
*/
void __devinit
void
e100_set_int_option(int *option, int val, int min, int max, int default_val,
char *name)
{
......@@ -928,7 +928,7 @@ e100_set_int_option(int *option, int val, int min, int max, int default_val,
* Otherwise, if the value is invalid (not 0 or 1),
* change it to the default.
*/
void __devinit
void
e100_set_bool_option(struct e100_private *bdp, int val, u32 mask,
int default_val, char *name)
{
......@@ -1241,7 +1241,7 @@ e100_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
* true: if successful
* false: otherwise
*/
static unsigned char __devinit
static unsigned char
e100_init(struct e100_private *bdp)
{
u32 st_timeout = 0;
......@@ -1290,7 +1290,7 @@ e100_init(struct e100_private *bdp)
* true: if S/W was successfully initialized
* false: otherwise
*/
static unsigned char __devinit
static unsigned char
e100_sw_init(struct e100_private *bdp)
{
bdp->next_cu_cmd = START_WAIT; // init the next cu state
......@@ -1318,7 +1318,7 @@ e100_sw_init(struct e100_private *bdp)
return 1;
}
static void __devinit
static void
e100_tco_workaround(struct e100_private *bdp)
{
int i;
......@@ -1519,7 +1519,7 @@ e100_setup_tcb_pool(tcb_t *head, unsigned int qlen, struct e100_private *bdp)
* 0: if the operation was successful
* %-ENOMEM: if memory allocation failed
*/
unsigned char __devinit
unsigned char
e100_alloc_space(struct e100_private *bdp)
{
unsigned long off;
......@@ -2508,7 +2508,7 @@ e100_cmd_complete_location(struct e100_private *bdp)
* true: if successfully cleared stat counters
* false: otherwise
*/
static unsigned char __devinit
static unsigned char
e100_clr_cntrs(struct e100_private *bdp)
{
volatile u32 *pcmd_complete;
......@@ -2873,7 +2873,7 @@ e100_load_microcode(struct e100_private *bdp)
/***************************************************************************/
/* Read PWA (printed wired assembly) number */
void __devinit
void
e100_rd_pwa_no(struct e100_private *bdp)
{
bdp->pwa_no = e100_eeprom_read(bdp, EEPROM_PWA_NO);
......@@ -2882,7 +2882,7 @@ e100_rd_pwa_no(struct e100_private *bdp)
}
/* Read the permanent ethernet address from the eprom. */
void __devinit
void
e100_rd_eaddr(struct e100_private *bdp)
{
int i;
......@@ -2947,7 +2947,7 @@ e100_D101M_checksum(struct e100_private *bdp, struct sk_buff *skb)
/***************************************************************************/
/* Print the board's configuration */
void __devinit
void
e100_print_brd_conf(struct e100_private *bdp)
{
/* Print the string if checksum Offloading was enabled */
......@@ -2975,7 +2975,7 @@ e100_print_brd_conf(struct e100_private *bdp)
* true: if successfull
* false: otherwise
*/
static unsigned char __devinit
static unsigned char
e100_pci_setup(struct pci_dev *pcid, struct e100_private *bdp)
{
struct net_device *dev = bdp->device;
......@@ -3754,7 +3754,7 @@ e100_ethtool_led_blink(struct net_device *dev, struct ifreq *ifr)
return 0;
}
static inline int __devinit
static inline int
e100_10BaseT_adapter(struct e100_private *bdp)
{
return ((bdp->pdev->device == 0x1229) &&
......@@ -3762,7 +3762,7 @@ e100_10BaseT_adapter(struct e100_private *bdp)
(bdp->pdev->subsystem_device == 0x0003));
}
static void __devinit
static void
e100_get_speed_duplex_caps(struct e100_private *bdp)
{
u16 status;
......
......@@ -132,7 +132,7 @@ e100_mdi_read(struct e100_private *bdp, u32 reg_addr, u32 phy_addr, u16 *data)
}
}
static unsigned char __devinit
static unsigned char
e100_phy_valid(struct e100_private *bdp, unsigned int phy_address)
{
u16 ctrl_reg, stat_reg;
......@@ -150,7 +150,7 @@ e100_phy_valid(struct e100_private *bdp, unsigned int phy_address)
return true;
}
static void __devinit
static void
e100_phy_address_detect(struct e100_private *bdp)
{
unsigned int addr;
......@@ -180,7 +180,7 @@ e100_phy_address_detect(struct e100_private *bdp)
}
}
static void __devinit
static void
e100_phy_id_detect(struct e100_private *bdp)
{
u16 low_id_reg, high_id_reg;
......@@ -204,7 +204,7 @@ e100_phy_id_detect(struct e100_private *bdp)
((unsigned int) high_id_reg << 16));
}
static void __devinit
static void
e100_phy_isolate(struct e100_private *bdp)
{
unsigned int phy_address;
......@@ -227,7 +227,7 @@ e100_phy_isolate(struct e100_private *bdp)
}
}
static unsigned char __devinit
static unsigned char
e100_phy_specific_setup(struct e100_private *bdp)
{
u16 misc_reg;
......@@ -380,7 +380,7 @@ e100_phy_fix_squelch(struct e100_private *bdp)
* Returns:
* NOTHING
*/
static void __devinit
static void
e100_fix_polarity(struct e100_private *bdp)
{
u16 status;
......@@ -916,7 +916,7 @@ e100_phy_reset(struct e100_private *bdp)
schedule_timeout(HZ / 2);
}
unsigned char __devinit
unsigned char
e100_phy_init(struct e100_private *bdp)
{
e100_phy_reset(bdp);
......
......@@ -18,6 +18,7 @@
preliminary Rev. 1.0 Jan. 18, 1998
http://www.sis.com.tw/support/databook.htm
Rev 1.08.07 Nov. 2 2003 Daniele Venzano <webvenza@libero.it> add suspend/resume support
Rev 1.08.06 Sep. 24 2002 Mufasa Yang bug fix for Tx timeout & add SiS963 support
Rev 1.08.05 Jun. 6 2002 Mufasa Yang bug fix for read_eeprom & Tx descriptor over-boundary
Rev 1.08.04 Apr. 25 2002 Mufasa Yang <mufasa@sis.com.tw> added SiS962 support
......@@ -72,7 +73,7 @@
#include "sis900.h"
#define SIS900_MODULE_NAME "sis900"
#define SIS900_DRV_VERSION "v1.08.06 9/24/2002"
#define SIS900_DRV_VERSION "v1.08.07 11/02/2003"
static char version[] __devinitdata =
KERN_INFO "sis900.c: " SIS900_DRV_VERSION "\n";
......@@ -169,6 +170,7 @@ struct sis900_private {
unsigned int tx_full; /* The Tx queue is full. */
u8 host_bridge_rev;
u32 pci_state[16];
};
MODULE_AUTHOR("Jim Huang <cmhuang@sis.com.tw>, Ollie Lho <ollie@sis.com.tw>");
......@@ -305,7 +307,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev, struct net_de
*( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
}
/* enable packet filitering */
/* enable packet filtering */
outl(rfcrSave | RFEN, rfcr + ioaddr);
return 1;
......@@ -994,7 +996,7 @@ sis900_init_rxfilter (struct net_device * net_dev)
}
}
/* enable packet filitering */
/* enable packet filtering */
outl(rfcrSave | RFEN, rfcr + ioaddr);
}
......@@ -1466,7 +1468,7 @@ static void sis900_tx_timeout(struct net_device *net_dev)
* @net_dev: the net device to transmit with
*
* Set the transmit buffer descriptor,
* and write TxENA to enable transimt state machine.
* and write TxENA to enable transmit state machine.
* tell upper layer if the buffer is full
*/
......@@ -2184,11 +2186,72 @@ static void __devexit sis900_remove(struct pci_dev *pci_dev)
pci_set_drvdata(pci_dev, NULL);
}
#ifdef CONFIG_PM
static int sis900_suspend(struct pci_dev *pci_dev, u32 state)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
struct sis900_private *sis_priv = net_dev->priv;
long ioaddr = net_dev->base_addr;
if(!netif_running(net_dev))
return 0;
netif_stop_queue(net_dev);
/* Stop the chip's Tx and Rx Status Machine */
outl(RxDIS | TxDIS | inl(ioaddr + cr), ioaddr + cr);
pci_set_power_state(pci_dev, 3);
pci_save_state(pci_dev, sis_priv->pci_state);
return 0;
}
static int sis900_resume(struct pci_dev *pci_dev)
{
struct net_device *net_dev = pci_get_drvdata(pci_dev);
struct sis900_private *sis_priv = net_dev->priv;
long ioaddr = net_dev->base_addr;
if(!netif_running(net_dev))
return 0;
pci_restore_state(pci_dev, sis_priv->pci_state);
pci_set_power_state(pci_dev, 0);
sis900_init_rxfilter(net_dev);
sis900_init_tx_ring(net_dev);
sis900_init_rx_ring(net_dev);
set_rx_mode(net_dev);
netif_device_attach(net_dev);
netif_start_queue(net_dev);
/* Workaround for EDB */
sis900_set_mode(ioaddr, HW_SPEED_10_MBPS, FDX_CAPABLE_HALF_SELECTED);
/* Enable all known interrupts by setting the interrupt mask. */
outl((RxSOVR|RxORN|RxERR|RxOK|TxURN|TxERR|TxIDLE), ioaddr + imr);
outl(RxENA | inl(ioaddr + cr), ioaddr + cr);
outl(IE, ioaddr + ier);
sis900_check_mode(net_dev, sis_priv->mii);
return 0;
}
#endif /* CONFIG_PM */
static struct pci_driver sis900_pci_driver = {
.name = SIS900_MODULE_NAME,
.id_table = sis900_pci_tbl,
.probe = sis900_probe,
.remove = __devexit_p(sis900_remove),
#ifdef CONFIG_PM
.suspend = sis900_suspend,
.resume = sis900_resume,
#endif /* CONFIG_PM */
};
static int __init sis900_init_module(void)
......
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