Commit 26623ba3 authored by Linus Torvalds's avatar Linus Torvalds

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

into ppc970.osdl.org:/home/torvalds/v2.6/linux
parents fa1b4579 db30efc4
...@@ -196,6 +196,7 @@ struct e1000_adapter { ...@@ -196,6 +196,7 @@ struct e1000_adapter {
uint32_t part_num; uint32_t part_num;
uint32_t wol; uint32_t wol;
uint32_t smartspeed; uint32_t smartspeed;
uint32_t en_mng_pt;
uint16_t link_speed; uint16_t link_speed;
uint16_t link_duplex; uint16_t link_duplex;
spinlock_t stats_lock; spinlock_t stats_lock;
......
...@@ -265,6 +265,17 @@ e1000_set_mac_type(struct e1000_hw *hw) ...@@ -265,6 +265,17 @@ e1000_set_mac_type(struct e1000_hw *hw)
return -E1000_ERR_MAC_TYPE; return -E1000_ERR_MAC_TYPE;
} }
switch(hw->mac_type) {
case e1000_82541:
case e1000_82547:
case e1000_82541_rev_2:
case e1000_82547_rev_2:
hw->asf_firmware_present = TRUE;
break;
default:
break;
}
return E1000_SUCCESS; return E1000_SUCCESS;
} }
...@@ -5189,3 +5200,27 @@ e1000_set_vco_speed(struct e1000_hw *hw) ...@@ -5189,3 +5200,27 @@ e1000_set_vco_speed(struct e1000_hw *hw)
return E1000_SUCCESS; return E1000_SUCCESS;
} }
/******************************************************************************
* Verifies the hardware needs to allow ARPs to be processed by the host
*
* hw - Struct containing variables accessed by shared code
*
* returns: - TRUE/FALSE
*
*****************************************************************************/
uint32_t
e1000_enable_mng_pass_thru(struct e1000_hw *hw)
{
uint32_t manc;
if (hw->asf_firmware_present) {
manc = E1000_READ_REG(hw, MANC);
if (!(manc & E1000_MANC_RCV_TCO_EN) ||
!(manc & E1000_MANC_EN_MAC_ADDR_FILTER))
return FALSE;
if ((manc & E1000_MANC_SMBUS_EN) && !(manc & E1000_MANC_ASF_EN))
return TRUE;
}
return FALSE;
}
...@@ -307,6 +307,7 @@ int32_t e1000_led_off(struct e1000_hw *hw); ...@@ -307,6 +307,7 @@ int32_t e1000_led_off(struct e1000_hw *hw);
/* Adaptive IFS Functions */ /* Adaptive IFS Functions */
/* Everything else */ /* Everything else */
uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw);
void e1000_clear_hw_cntrs(struct e1000_hw *hw); void e1000_clear_hw_cntrs(struct e1000_hw *hw);
void e1000_reset_adaptive(struct e1000_hw *hw); void e1000_reset_adaptive(struct e1000_hw *hw);
void e1000_update_adaptive(struct e1000_hw *hw); void e1000_update_adaptive(struct e1000_hw *hw);
...@@ -983,6 +984,7 @@ struct e1000_hw { ...@@ -983,6 +984,7 @@ struct e1000_hw {
e1000_ms_type master_slave; e1000_ms_type master_slave;
e1000_ms_type original_master_slave; e1000_ms_type original_master_slave;
e1000_ffe_config ffe_config_state; e1000_ffe_config ffe_config_state;
uint32_t asf_firmware_present;
unsigned long io_base; unsigned long io_base;
uint32_t phy_id; uint32_t phy_id;
uint32_t phy_revision; uint32_t phy_revision;
......
...@@ -299,7 +299,7 @@ e1000_down(struct e1000_adapter *adapter) ...@@ -299,7 +299,7 @@ e1000_down(struct e1000_adapter *adapter)
void void
e1000_reset(struct e1000_adapter *adapter) e1000_reset(struct e1000_adapter *adapter)
{ {
uint32_t pba; uint32_t pba, manc;
/* Repartition Pba for greater than 9k mtu /* Repartition Pba for greater than 9k mtu
* To take effect CTRL.RST is required. * To take effect CTRL.RST is required.
*/ */
...@@ -341,6 +341,12 @@ e1000_reset(struct e1000_adapter *adapter) ...@@ -341,6 +341,12 @@ e1000_reset(struct e1000_adapter *adapter)
e1000_reset_adaptive(&adapter->hw); e1000_reset_adaptive(&adapter->hw);
e1000_phy_get_info(&adapter->hw, &adapter->phy_info); e1000_phy_get_info(&adapter->hw, &adapter->phy_info);
if(adapter->en_mng_pt) {
manc = E1000_READ_REG(&adapter->hw, MANC);
manc |= (E1000_MANC_ARP_EN | E1000_MANC_EN_MNG2HOST);
E1000_WRITE_REG(&adapter->hw, MANC, manc);
}
} }
/** /**
...@@ -483,6 +489,8 @@ e1000_probe(struct pci_dev *pdev, ...@@ -483,6 +489,8 @@ e1000_probe(struct pci_dev *pdev,
if(pci_using_dac) if(pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HIGHDMA;
adapter->en_mng_pt = e1000_enable_mng_pass_thru(&adapter->hw);
/* before reading the EEPROM, reset the controller to /* before reading the EEPROM, reset the controller to
* put the device in a known good starting state */ * put the device in a known good starting state */
......
...@@ -499,6 +499,8 @@ static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp) ...@@ -499,6 +499,8 @@ static int eql_g_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
return -ENODEV; return -ENODEV;
ret = -EINVAL; ret = -EINVAL;
if (!slave_dev)
return ret;
spin_lock_bh(&eql->queue.lock); spin_lock_bh(&eql->queue.lock);
if (eql_is_slave(slave_dev)) { if (eql_is_slave(slave_dev)) {
...@@ -534,6 +536,8 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp) ...@@ -534,6 +536,8 @@ static int eql_s_slave_cfg(struct net_device *dev, slave_config_t __user *scp)
return -ENODEV; return -ENODEV;
ret = -EINVAL; ret = -EINVAL;
if (!slave_dev)
return ret;
eql = dev->priv; eql = dev->priv;
spin_lock_bh(&eql->queue.lock); spin_lock_bh(&eql->queue.lock);
......
...@@ -207,10 +207,8 @@ KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu> ...@@ -207,10 +207,8 @@ KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>
/* Condensed bus+endian portability operations. */ /* Condensed bus+endian portability operations. */
#if ADDRLEN == 64 #if ADDRLEN == 64
#define cpu_to_leXX(addr) cpu_to_le64(addr) #define cpu_to_leXX(addr) cpu_to_le64(addr)
#define desc_to_virt(addr) bus_to_virt(le64_to_cpu(addr))
#else #else
#define cpu_to_leXX(addr) cpu_to_le32(addr) #define cpu_to_leXX(addr) cpu_to_le32(addr)
#define desc_to_virt(addr) bus_to_virt(le32_to_cpu(addr))
#endif #endif
...@@ -1502,7 +1500,7 @@ static int hamachi_rx(struct net_device *dev) ...@@ -1502,7 +1500,7 @@ static int hamachi_rx(struct net_device *dev)
desc->addr, desc->addr,
hmp->rx_buf_sz, hmp->rx_buf_sz,
PCI_DMA_FROMDEVICE); PCI_DMA_FROMDEVICE);
buf_addr = desc_to_virt(desc->addr); buf_addr = (u8 *) hmp->rx_skbuff[entry]->tail;
frame_status = le32_to_cpu(get_unaligned((s32*)&(buf_addr[data_size - 12]))); frame_status = le32_to_cpu(get_unaligned((s32*)&(buf_addr[data_size - 12])));
if (hamachi_debug > 4) if (hamachi_debug > 4)
printk(KERN_DEBUG " hamachi_rx() status was %8.8x.\n", printk(KERN_DEBUG " hamachi_rx() status was %8.8x.\n",
......
...@@ -588,6 +588,8 @@ static int hdlcdrv_close(struct net_device *dev) ...@@ -588,6 +588,8 @@ static int hdlcdrv_close(struct net_device *dev)
return -EINVAL; return -EINVAL;
s = (struct hdlcdrv_state *)dev->priv; s = (struct hdlcdrv_state *)dev->priv;
netif_stop_queue(dev);
if (s->ops && s->ops->close) if (s->ops && s->ops->close)
i = s->ops->close(dev); i = s->ops->close(dev);
if (s->skb) if (s->skb)
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
*************************************************************************/ *************************************************************************/
#define DRV_NAME "pcnet32" #define DRV_NAME "pcnet32"
#define DRV_VERSION "1.30c" #define DRV_VERSION "1.30f"
#define DRV_RELDATE "05.25.2004" #define DRV_RELDATE "06.16.2004"
#define PFX DRV_NAME ": " #define PFX DRV_NAME ": "
static const char *version = static const char *version =
...@@ -245,6 +245,11 @@ static int full_duplex[MAX_UNITS]; ...@@ -245,6 +245,11 @@ static int full_duplex[MAX_UNITS];
* v1.30b 24 May 2004 Don Fry fix bogus tx carrier errors with 79c973, * v1.30b 24 May 2004 Don Fry fix bogus tx carrier errors with 79c973,
* assisted by Bruce Penrod <bmpenrod@endruntechnologies.com>. * assisted by Bruce Penrod <bmpenrod@endruntechnologies.com>.
* v1.30c 25 May 2004 Don Fry added netif_wake_queue after pcnet32_restart. * v1.30c 25 May 2004 Don Fry added netif_wake_queue after pcnet32_restart.
* v1.30d 01 Jun 2004 Don Fry discard oversize rx packets.
* v1.30e 11 Jun 2004 Don Fry recover after fifo error and rx hang.
* v1.30f 16 Jun 2004 Don Fry cleanup IRQ to allow 0 and 1 for PCI,
* expanding on suggestions from Ralf Baechle <ralf@linux-mips.org>,
* and Brian Murphy <brian@murphy.dk>.
*/ */
...@@ -360,7 +365,7 @@ struct pcnet32_private { ...@@ -360,7 +365,7 @@ struct pcnet32_private {
static void pcnet32_probe_vlbus(void); static void pcnet32_probe_vlbus(void);
static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *); static int pcnet32_probe_pci(struct pci_dev *, const struct pci_device_id *);
static int pcnet32_probe1(unsigned long, unsigned int, int, struct pci_dev *); static int pcnet32_probe1(unsigned long, int, struct pci_dev *);
static int pcnet32_open(struct net_device *); static int pcnet32_open(struct net_device *);
static int pcnet32_init_ring(struct net_device *); static int pcnet32_init_ring(struct net_device *);
static int pcnet32_start_xmit(struct sk_buff *, struct net_device *); static int pcnet32_start_xmit(struct sk_buff *, struct net_device *);
...@@ -958,7 +963,7 @@ pcnet32_probe_vlbus(void) ...@@ -958,7 +963,7 @@ pcnet32_probe_vlbus(void)
if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) { if (request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_vlbus")) {
/* check if there is really a pcnet chip on that ioaddr */ /* check if there is really a pcnet chip on that ioaddr */
if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) { if ((inb(ioaddr + 14) == 0x57) && (inb(ioaddr + 15) == 0x57)) {
pcnet32_probe1(ioaddr, 0, 0, NULL); pcnet32_probe1(ioaddr, 0, NULL);
} else { } else {
release_region(ioaddr, PCNET32_TOTAL_SIZE); release_region(ioaddr, PCNET32_TOTAL_SIZE);
} }
...@@ -999,7 +1004,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -999,7 +1004,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
return -EBUSY; return -EBUSY;
} }
return pcnet32_probe1(ioaddr, pdev->irq, 1, pdev); return pcnet32_probe1(ioaddr, 1, pdev);
} }
...@@ -1008,8 +1013,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1008,8 +1013,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)
* pdev will be NULL when called from pcnet32_probe_vlbus. * pdev will be NULL when called from pcnet32_probe_vlbus.
*/ */
static int __devinit static int __devinit
pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared, pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
struct pci_dev *pdev)
{ {
struct pcnet32_private *lp; struct pcnet32_private *lp;
dma_addr_t lp_dma_addr; dma_addr_t lp_dma_addr;
...@@ -1270,11 +1274,8 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared, ...@@ -1270,11 +1274,8 @@ pcnet32_probe1(unsigned long ioaddr, unsigned int irq_line, int shared,
a->write_csr(ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private, a->write_csr(ioaddr, 2, (lp->dma_addr + offsetof(struct pcnet32_private,
init_block)) >> 16); init_block)) >> 16);
if (irq_line) { if (pdev) { /* use the IRQ provided by PCI */
dev->irq = irq_line; dev->irq = pdev->irq;
}
if (dev->irq >= 2) {
if (pcnet32_debug & NETIF_MSG_PROBE) if (pcnet32_debug & NETIF_MSG_PROBE)
printk(" assigned IRQ %d.\n", dev->irq); printk(" assigned IRQ %d.\n", dev->irq);
} else { } else {
...@@ -1362,8 +1363,7 @@ pcnet32_open(struct net_device *dev) ...@@ -1362,8 +1363,7 @@ pcnet32_open(struct net_device *dev)
int rc; int rc;
unsigned long flags; unsigned long flags;
if (dev->irq == 0 || if (request_irq(dev->irq, &pcnet32_interrupt,
request_irq(dev->irq, &pcnet32_interrupt,
lp->shared_irq ? SA_SHIRQ : 0, dev->name, (void *)dev)) { lp->shared_irq ? SA_SHIRQ : 0, dev->name, (void *)dev)) {
return -EAGAIN; return -EAGAIN;
} }
...@@ -1531,13 +1531,15 @@ pcnet32_purge_tx_ring(struct net_device *dev) ...@@ -1531,13 +1531,15 @@ pcnet32_purge_tx_ring(struct net_device *dev)
int i; int i;
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
lp->tx_ring[i].status = 0; /* CPU owns buffer */
wmb(); /* Make sure adapter sees owner change */
if (lp->tx_skbuff[i]) { if (lp->tx_skbuff[i]) {
pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i], pci_unmap_single(lp->pci_dev, lp->tx_dma_addr[i],
lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE); lp->tx_skbuff[i]->len, PCI_DMA_TODEVICE);
dev_kfree_skb_any(lp->tx_skbuff[i]); dev_kfree_skb_any(lp->tx_skbuff[i]);
lp->tx_skbuff[i] = NULL;
lp->tx_dma_addr[i] = 0;
} }
lp->tx_skbuff[i] = NULL;
lp->tx_dma_addr[i] = 0;
} }
} }
...@@ -1566,21 +1568,23 @@ pcnet32_init_ring(struct net_device *dev) ...@@ -1566,21 +1568,23 @@ pcnet32_init_ring(struct net_device *dev)
skb_reserve (rx_skbuff, 2); skb_reserve (rx_skbuff, 2);
} }
rmb();
if (lp->rx_dma_addr[i] == 0) if (lp->rx_dma_addr[i] == 0)
lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail, lp->rx_dma_addr[i] = pci_map_single(lp->pci_dev, rx_skbuff->tail,
PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE); PKT_BUF_SZ-2, PCI_DMA_FROMDEVICE);
lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]); lp->rx_ring[i].base = (u32)le32_to_cpu(lp->rx_dma_addr[i]);
lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ); lp->rx_ring[i].buf_length = le16_to_cpu(2-PKT_BUF_SZ);
wmb(); /* Make sure owner changes after all others are visible */
lp->rx_ring[i].status = le16_to_cpu(0x8000); lp->rx_ring[i].status = le16_to_cpu(0x8000);
} }
/* The Tx buffer address is filled in as needed, but we do need to clear /* The Tx buffer address is filled in as needed, but we do need to clear
* the upper ownership bit. */ * the upper ownership bit. */
for (i = 0; i < TX_RING_SIZE; i++) { for (i = 0; i < TX_RING_SIZE; i++) {
lp->tx_ring[i].status = 0; /* CPU owns buffer */
wmb(); /* Make sure adapter sees owner change */
lp->tx_ring[i].base = 0; lp->tx_ring[i].base = 0;
lp->tx_ring[i].status = 0;
lp->tx_dma_addr[i] = 0; lp->tx_dma_addr[i] = 0;
} }
wmb(); /* Make sure all changes are visible */
lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS); lp->init_block.tlen_rlen = le16_to_cpu(TX_RING_LEN_BITS | RX_RING_LEN_BITS);
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
...@@ -1589,9 +1593,14 @@ pcnet32_init_ring(struct net_device *dev) ...@@ -1589,9 +1593,14 @@ pcnet32_init_ring(struct net_device *dev)
offsetof(struct pcnet32_private, rx_ring)); offsetof(struct pcnet32_private, rx_ring));
lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr + lp->init_block.tx_ring = (u32)le32_to_cpu(lp->dma_addr +
offsetof(struct pcnet32_private, tx_ring)); offsetof(struct pcnet32_private, tx_ring));
wmb(); /* Make sure all changes are visible */
return 0; return 0;
} }
/* the pcnet32 has been issued a stop or reset. Wait for the stop bit
* then flush the pending transmit operations, re-initialize the ring,
* and tell the chip to initialize.
*/
static void static void
pcnet32_restart(struct net_device *dev, unsigned int csr0_bits) pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
{ {
...@@ -1599,6 +1608,15 @@ pcnet32_restart(struct net_device *dev, unsigned int csr0_bits) ...@@ -1599,6 +1608,15 @@ pcnet32_restart(struct net_device *dev, unsigned int csr0_bits)
unsigned long ioaddr = dev->base_addr; unsigned long ioaddr = dev->base_addr;
int i; int i;
/* wait for stop */
for (i=0; i<100; i++)
if (lp->a.read_csr(ioaddr, 0) & 0x0004)
break;
if (i >= 100 && netif_msg_drv(lp))
printk(KERN_ERR "%s: pcnet32_restart timed out waiting for stop.\n",
dev->name);
pcnet32_purge_tx_ring(dev); pcnet32_purge_tx_ring(dev);
if (pcnet32_init_ring(dev)) if (pcnet32_init_ring(dev))
return; return;
...@@ -1857,15 +1875,16 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs) ...@@ -1857,15 +1875,16 @@ pcnet32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
} }
if (must_restart) { if (must_restart) {
/* stop the chip to clear the error condition, then restart */ /* reset the chip to clear the error condition, then restart */
lp->a.write_csr (ioaddr, 0, 0x0004); lp->a.reset(ioaddr);
lp->a.write_csr(ioaddr, 4, 0x0915);
pcnet32_restart(dev, 0x0002); pcnet32_restart(dev, 0x0002);
netif_wake_queue(dev); netif_wake_queue(dev);
} }
} }
/* Clear any other interrupt, and set interrupt enable. */ /* Set interrupt enable. */
lp->a.write_csr (ioaddr, 0, 0x7940); lp->a.write_csr (ioaddr, 0, 0x0040);
lp->a.write_rap (ioaddr,rap); lp->a.write_rap (ioaddr,rap);
if (netif_msg_intr(lp)) if (netif_msg_intr(lp))
...@@ -1907,7 +1926,13 @@ pcnet32_rx(struct net_device *dev) ...@@ -1907,7 +1926,13 @@ pcnet32_rx(struct net_device *dev)
short pkt_len = (le32_to_cpu(lp->rx_ring[entry].msg_length) & 0xfff)-4; short pkt_len = (le32_to_cpu(lp->rx_ring[entry].msg_length) & 0xfff)-4;
struct sk_buff *skb; struct sk_buff *skb;
if (pkt_len < 60) { /* Discard oversize frames. */
if (unlikely(pkt_len > PKT_BUF_SZ - 2)) {
if (netif_msg_drv(lp))
printk(KERN_ERR "%s: Impossible packet size %d!\n",
dev->name, pkt_len);
lp->stats.rx_errors++;
} else if (pkt_len < 60) {
if (netif_msg_rx_err(lp)) if (netif_msg_rx_err(lp))
printk(KERN_ERR "%s: Runt packet!\n", dev->name); printk(KERN_ERR "%s: Runt packet!\n", dev->name);
lp->stats.rx_errors++; lp->stats.rx_errors++;
......
...@@ -2900,15 +2900,15 @@ static void __exit ...@@ -2900,15 +2900,15 @@ static void __exit
sbmac_cleanup_module(void) sbmac_cleanup_module(void)
{ {
struct net_device *dev; struct net_device *dev;
sbmac_port_t port;
int idx; int idx;
for (idx = 0; idx < MAX_UNITS; idx++) { for (idx = 0; idx < MAX_UNITS; idx++) {
struct sbmac_softc *sc;
dev = dev_sbmac[idx]; dev = dev_sbmac[idx];
if (!dev) if (!dev)
continue; continue;
struct sbmac_softc *sc = netdev_priv(dev); sc = netdev_priv(dev);
unregister_netdev(dev); unregister_netdev(dev);
sbmac_uninitctx(sc); sbmac_uninitctx(sc);
free_netdev(dev); free_netdev(dev);
......
This diff is collapsed.
...@@ -58,7 +58,8 @@ ...@@ -58,7 +58,8 @@
/* 3Com (0x10b7) */ \ /* 3Com (0x10b7) */ \
if (pdev->vendor == 0x10b7) { \ if (pdev->vendor == 0x10b7) { \
/* Gigabit Ethernet Adapter (0x1700) */ \ /* Gigabit Ethernet Adapter (0x1700) */ \
if ((pdev->device == 0x1700)) { \ if ((pdev->device == 0x1700) || \
(pdev->device == 0x80eb)) { \
result = SK_TRUE; \ result = SK_TRUE; \
} \ } \
/* SysKonnect (0x1148) */ \ /* SysKonnect (0x1148) */ \
......
...@@ -96,14 +96,13 @@ static const u_char cf_to_ptype[] = { ...@@ -96,14 +96,13 @@ static const u_char cf_to_ptype[] = {
/* /*
* function declarations * function declarations
*/ */
static void cfm_fsm() ; static void cfm_fsm(struct s_smc *smc, int cmd);
/* /*
init CFM state machine init CFM state machine
clear all CFM vars and flags clear all CFM vars and flags
*/ */
void cfm_init(smc) void cfm_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->mib.fddiSMTCF_State = ACTIONS(SC0_ISOLATED) ; smc->mib.fddiSMTCF_State = ACTIONS(SC0_ISOLATED) ;
smc->r.rm_join = 0 ; smc->r.rm_join = 0 ;
...@@ -118,9 +117,7 @@ struct s_smc *smc ; ...@@ -118,9 +117,7 @@ struct s_smc *smc ;
#define THRU_ENABLED(smc) (smc->y[PA].pc_mode != PM_TREE && \ #define THRU_ENABLED(smc) (smc->y[PA].pc_mode != PM_TREE && \
smc->y[PB].pc_mode != PM_TREE) smc->y[PB].pc_mode != PM_TREE)
/* Selection criteria for the ports */ /* Selection criteria for the ports */
static void selection_criteria (smc,phy) static void selection_criteria (struct s_smc *smc, struct s_phy *phy)
struct s_smc *smc ;
struct s_phy *phy ;
{ {
switch (phy->mib->fddiPORTMy_Type) { switch (phy->mib->fddiPORTMy_Type) {
...@@ -146,8 +143,7 @@ struct s_phy *phy ; ...@@ -146,8 +143,7 @@ struct s_phy *phy ;
} }
void all_selection_criteria (smc) void all_selection_criteria(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct s_phy *phy ; struct s_phy *phy ;
int p ; int p ;
...@@ -158,9 +154,7 @@ struct s_smc *smc ; ...@@ -158,9 +154,7 @@ struct s_smc *smc ;
} }
} }
static void cem_priv_state (smc, event) static void cem_priv_state(struct s_smc *smc, int event)
struct s_smc *smc ;
int event ;
/* State machine for private PORT states: used to optimize dual homing */ /* State machine for private PORT states: used to optimize dual homing */
{ {
int np; /* Number of the port */ int np; /* Number of the port */
...@@ -216,9 +210,7 @@ int event ; ...@@ -216,9 +210,7 @@ int event ;
process event process event
until SM is stable until SM is stable
*/ */
void cfm(smc,event) void cfm(struct s_smc *smc, int event)
struct s_smc *smc ;
int event ;
{ {
int state ; /* remember last state */ int state ; /* remember last state */
int cond ; int cond ;
...@@ -290,9 +282,7 @@ int event ; ...@@ -290,9 +282,7 @@ int event ;
process CFM event process CFM event
*/ */
/*ARGSUSED1*/ /*ARGSUSED1*/
static void cfm_fsm(smc,cmd) static void cfm_fsm(struct s_smc *smc, int cmd)
struct s_smc *smc ;
int cmd ;
{ {
switch(smc->mib.fddiSMTCF_State) { switch(smc->mib.fddiSMTCF_State) {
case ACTIONS(SC0_ISOLATED) : case ACTIONS(SC0_ISOLATED) :
...@@ -550,8 +540,7 @@ int cmd ; ...@@ -550,8 +540,7 @@ int cmd ;
* return : * return :
* PA or PB * PA or PB
*/ */
int cfm_get_mac_input(smc) int cfm_get_mac_input(struct s_smc *smc)
struct s_smc *smc ;
{ {
return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA) ; smc->mib.fddiSMTCF_State == SC5_THRU_B) ? PB : PA) ;
...@@ -562,8 +551,7 @@ struct s_smc *smc ; ...@@ -562,8 +551,7 @@ struct s_smc *smc ;
* return : * return :
* PA or PB * PA or PB
*/ */
int cfm_get_mac_output(smc) int cfm_get_mac_output(struct s_smc *smc)
struct s_smc *smc ;
{ {
return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B || return((smc->mib.fddiSMTCF_State == SC10_C_WRAP_B ||
smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA) ; smc->mib.fddiSMTCF_State == SC4_THRU_A) ? PB : PA) ;
...@@ -603,10 +591,7 @@ static char path_iso_s[] = { ...@@ -603,10 +591,7 @@ static char path_iso_s[] = {
0,0, 0,RES_MAC, 0,INDEX_MAC, 0,PATH_ISO, 0,0, 0,RES_MAC, 0,INDEX_MAC, 0,PATH_ISO,
} ; } ;
int cem_build_path(smc,to,path_index) int cem_build_path(struct s_smc *smc, char *to, int path_index)
struct s_smc *smc ;
char *to ;
int path_index ;
{ {
char *path ; char *path ;
int len ; int len ;
......
This diff is collapsed.
...@@ -94,17 +94,16 @@ static const char * const ecm_events[] = { ...@@ -94,17 +94,16 @@ static const char * const ecm_events[] = {
* function declarations * function declarations
*/ */
static void ecm_fsm() ; static void ecm_fsm(struct s_smc *smc, int cmd);
static void start_ecm_timer() ; static void start_ecm_timer(struct s_smc *smc, u_long value, int event);
static void stop_ecm_timer() ; static void stop_ecm_timer(struct s_smc *smc);
static void prop_actions() ; static void prop_actions(struct s_smc *smc);
/* /*
init ECM state machine init ECM state machine
clear all ECM vars and flags clear all ECM vars and flags
*/ */
void ecm_init(smc) void ecm_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->e.path_test = PT_PASSED ; smc->e.path_test = PT_PASSED ;
smc->e.trace_prop = 0 ; smc->e.trace_prop = 0 ;
...@@ -122,9 +121,7 @@ struct s_smc *smc ; ...@@ -122,9 +121,7 @@ struct s_smc *smc ;
process event process event
until SM is stable until SM is stable
*/ */
void ecm(smc,event) void ecm(struct s_smc *smc, int event)
struct s_smc *smc ;
int event ;
{ {
int state ; int state ;
...@@ -143,9 +140,7 @@ int event ; ...@@ -143,9 +140,7 @@ int event ;
/* /*
process ECM event process ECM event
*/ */
static void ecm_fsm(smc,cmd) static void ecm_fsm(struct s_smc *smc, int cmd)
struct s_smc *smc ;
int cmd ;
{ {
int ls_a ; /* current line state PHY A */ int ls_a ; /* current line state PHY A */
int ls_b ; /* current line state PHY B */ int ls_b ; /* current line state PHY B */
...@@ -429,8 +424,7 @@ int cmd ; ...@@ -429,8 +424,7 @@ int cmd ;
/* /*
* trace propagation actions for SAS & DAS * trace propagation actions for SAS & DAS
*/ */
static void prop_actions(smc) static void prop_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
int port_in = 0 ; int port_in = 0 ;
int port_out = 0 ; int port_out = 0 ;
...@@ -480,8 +474,7 @@ struct s_smc *smc ; ...@@ -480,8 +474,7 @@ struct s_smc *smc ;
/* /*
* trace propagation actions for Concentrator * trace propagation actions for Concentrator
*/ */
static void prop_actions(smc) static void prop_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
int initiator ; int initiator ;
int upstream ; int upstream ;
...@@ -527,10 +520,7 @@ struct s_smc *smc ; ...@@ -527,10 +520,7 @@ struct s_smc *smc ;
* SMT timer interface * SMT timer interface
* start ECM timer * start ECM timer
*/ */
static void start_ecm_timer(smc,value,event) static void start_ecm_timer(struct s_smc *smc, u_long value, int event)
struct s_smc *smc ;
u_long value;
int event ;
{ {
smt_timer_start(smc,&smc->e.ecm_timer,value,EV_TOKEN(EVENT_ECM,event)); smt_timer_start(smc,&smc->e.ecm_timer,value,EV_TOKEN(EVENT_ECM,event));
} }
...@@ -539,8 +529,7 @@ int event ; ...@@ -539,8 +529,7 @@ int event ;
* SMT timer interface * SMT timer interface
* stop ECM timer * stop ECM timer
*/ */
static void stop_ecm_timer(smc) static void stop_ecm_timer(struct s_smc *smc)
struct s_smc *smc ;
{ {
if (smc->e.ecm_timer.tm_active) if (smc->e.ecm_timer.tm_active)
smt_timer_stop(smc,&smc->e.ecm_timer) ; smt_timer_stop(smc,&smc->e.ecm_timer) ;
......
...@@ -80,8 +80,11 @@ static const struct fddi_addr null_addr = {{0,0,0,0,0,0}} ; ...@@ -80,8 +80,11 @@ static const struct fddi_addr null_addr = {{0,0,0,0,0,0}} ;
------------------------------------------------------------- -------------------------------------------------------------
*/ */
static void ess_send_response(), ess_config_fifo(), static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
ess_send_alc_req(), ess_send_frame() ; int sba_cmd);
static void ess_config_fifo(struct s_smc *smc);
static void ess_send_alc_req(struct s_smc *smc);
static void ess_send_frame(struct s_smc *smc, SMbuf *mb);
/* /*
------------------------------------------------------------- -------------------------------------------------------------
...@@ -89,26 +92,17 @@ static void ess_send_response(), ess_config_fifo(), ...@@ -89,26 +92,17 @@ static void ess_send_response(), ess_config_fifo(),
------------------------------------------------------------- -------------------------------------------------------------
*/ */
extern void *sm_to_para() ;
extern void smt_send_frame(), smt_free_mbuf(),
set_formac_tsync(), formac_reinit_tx() ;
extern int smt_check_para() ;
extern SMbuf *smt_get_mbuf(), *smt_build_frame() ;
extern u_long smt_get_tid() ;
/* /*
------------------------------------------------------------- -------------------------------------------------------------
PUBLIC FUNCTIONS: PUBLIC FUNCTIONS:
------------------------------------------------------------- -------------------------------------------------------------
*/ */
void ess_timer_poll(), ess_para_change() ; void ess_timer_poll(struct s_smc *smc);
void ess_para_change(struct s_smc *smc);
int ess_raf_received_pack(), process_bw_alloc() ; int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
int fs);
int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead);
/* /*
...@@ -120,11 +114,8 @@ extern u_long smt_get_tid() ; ...@@ -120,11 +114,8 @@ extern u_long smt_get_tid() ;
/* /*
* evaluate the RAF frame * evaluate the RAF frame
*/ */
int ess_raf_received_pack(smc,mb,sm,fs) int ess_raf_received_pack(struct s_smc *smc, SMbuf *mb, struct smt_header *sm,
struct s_smc *smc ; int fs)
SMbuf *mb ;
struct smt_header *sm ;
int fs ;
{ {
void *p ; /* universal pointer */ void *p ; /* universal pointer */
struct smt_p_0016 *cmd ; /* para: command for the ESS */ struct smt_p_0016 *cmd ; /* para: command for the ESS */
...@@ -384,10 +375,7 @@ int fs ; ...@@ -384,10 +375,7 @@ int fs ;
* determines the synchronous bandwidth, set the TSYNC register and the * determines the synchronous bandwidth, set the TSYNC register and the
* mib variables SBAPayload, SBAOverhead and fddiMACT-NEG. * mib variables SBAPayload, SBAOverhead and fddiMACT-NEG.
*/ */
int process_bw_alloc(smc,payload,overhead) int process_bw_alloc(struct s_smc *smc, long int payload, long int overhead)
struct s_smc *smc ;
long payload ;
long overhead ;
{ {
/* /*
* determine the synchronous bandwidth (sync_bw) in bytes per T-NEG, * determine the synchronous bandwidth (sync_bw) in bytes per T-NEG,
...@@ -483,10 +471,8 @@ long overhead ; ...@@ -483,10 +471,8 @@ long overhead ;
return(TRUE) ; return(TRUE) ;
} }
static void ess_send_response(smc,sm,sba_cmd) static void ess_send_response(struct s_smc *smc, struct smt_header *sm,
struct s_smc *smc ; int sba_cmd)
struct smt_header *sm ;
int sba_cmd ;
{ {
struct smt_sba_chg *chg ; struct smt_sba_chg *chg ;
SMbuf *mb ; SMbuf *mb ;
...@@ -550,9 +536,7 @@ int sba_cmd ; ...@@ -550,9 +536,7 @@ int sba_cmd ;
ess_send_frame(smc,mb) ; ess_send_frame(smc,mb) ;
} }
void ess_timer_poll(struct s_smc *smc)
void ess_timer_poll(smc)
struct s_smc *smc ;
{ {
if (!smc->ess.raf_act_timer_poll) if (!smc->ess.raf_act_timer_poll)
return ; return ;
...@@ -566,8 +550,7 @@ struct s_smc *smc ; ...@@ -566,8 +550,7 @@ struct s_smc *smc ;
} }
} }
static void ess_send_alc_req(smc) static void ess_send_alc_req(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct smt_sba_alc_req *req ; struct smt_sba_alc_req *req ;
SMbuf *mb ; SMbuf *mb ;
...@@ -675,9 +658,7 @@ struct s_smc *smc ; ...@@ -675,9 +658,7 @@ struct s_smc *smc ;
ess_send_frame(smc,mb) ; ess_send_frame(smc,mb) ;
} }
static void ess_send_frame(smc,mb) static void ess_send_frame(struct s_smc *smc, SMbuf *mb)
struct s_smc *smc ;
SMbuf *mb ;
{ {
/* /*
* check if the frame must be send to the own ESS * check if the frame must be send to the own ESS
...@@ -703,15 +684,13 @@ SMbuf *mb ; ...@@ -703,15 +684,13 @@ SMbuf *mb ;
} }
} }
void ess_para_change(smc) void ess_para_change(struct s_smc *smc)
struct s_smc *smc ;
{ {
(void)process_bw_alloc(smc,(long)smc->mib.a[PATH0].fddiPATHSbaPayload, (void)process_bw_alloc(smc,(long)smc->mib.a[PATH0].fddiPATHSbaPayload,
(long)smc->mib.a[PATH0].fddiPATHSbaOverhead) ; (long)smc->mib.a[PATH0].fddiPATHSbaOverhead) ;
} }
static void ess_config_fifo(smc) static void ess_config_fifo(struct s_smc *smc)
struct s_smc *smc ;
{ {
/* /*
* if nothing to do exit * if nothing to do exit
...@@ -738,3 +717,4 @@ struct s_smc *smc ; ...@@ -738,3 +717,4 @@ struct s_smc *smc ;
#endif /* ESS */ #endif /* ESS */
#endif /* no SLIM_SMT */ #endif /* no SLIM_SMT */
This diff is collapsed.
This diff is collapsed.
...@@ -12,6 +12,9 @@ ...@@ -12,6 +12,9 @@
* *
******************************************************************************/ ******************************************************************************/
#ifndef _SKFP_H_SMTSTATE_H_
#define _SKFP_H_SMTSTATE_H_
/* /*
* SMT state definitions * SMT state definitions
*/ */
...@@ -98,3 +101,6 @@ struct pcm_state { ...@@ -98,3 +101,6 @@ struct pcm_state {
struct smt_state { struct smt_state {
struct pcm_state pcm_state[NUMPHYS] ; /* port A & port B */ struct pcm_state pcm_state[NUMPHYS] ; /* port A & port B */
} ; } ;
#endif
This diff is collapsed.
...@@ -39,7 +39,7 @@ static const char ID_sccs[] = "@(#)hwt.c 1.13 97/04/23 (C) SK " ; ...@@ -39,7 +39,7 @@ static const char ID_sccs[] = "@(#)hwt.c 1.13 97/04/23 (C) SK " ;
* Prototypes of local functions. * Prototypes of local functions.
*/ */
/* 28-Jun-1994 sw - Note: hwt_restart() is also used in module 'drvfbi.c'. */ /* 28-Jun-1994 sw - Note: hwt_restart() is also used in module 'drvfbi.c'. */
/*static*/ void hwt_restart() ; /*static void hwt_restart() ; */
/************************ /************************
* *
...@@ -60,9 +60,7 @@ static const char ID_sccs[] = "@(#)hwt.c 1.13 97/04/23 (C) SK " ; ...@@ -60,9 +60,7 @@ static const char ID_sccs[] = "@(#)hwt.c 1.13 97/04/23 (C) SK " ;
************************/ ************************/
#define HWT_MAX (65000) #define HWT_MAX (65000)
void hwt_start(smc, time) void hwt_start(struct s_smc *smc, u_long time)
struct s_smc *smc ;
u_long time ;
{ {
u_short cnt ; u_short cnt ;
...@@ -115,8 +113,7 @@ u_long time ; ...@@ -115,8 +113,7 @@ u_long time ;
* Nothing. * Nothing.
* *
************************/ ************************/
void hwt_stop(smc) void hwt_stop(struct s_smc *smc)
struct s_smc *smc ;
{ {
#ifndef PCI #ifndef PCI
/* stop counter 0 by switching to mode 0 */ /* stop counter 0 by switching to mode 0 */
...@@ -145,8 +142,7 @@ struct s_smc *smc ; ...@@ -145,8 +142,7 @@ struct s_smc *smc ;
* Nothing. * Nothing.
* *
************************/ ************************/
void hwt_init(smc) void hwt_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->hw.t_start = 0 ; smc->hw.t_start = 0 ;
smc->hw.t_stop = 0 ; smc->hw.t_stop = 0 ;
...@@ -169,8 +165,7 @@ struct s_smc *smc ; ...@@ -169,8 +165,7 @@ struct s_smc *smc ;
* Nothing. * Nothing.
* *
************************/ ************************/
void hwt_restart(smc) void hwt_restart(struct s_smc *smc)
struct s_smc *smc ;
{ {
hwt_stop(smc) ; hwt_stop(smc) ;
#ifndef PCI #ifndef PCI
...@@ -193,8 +188,7 @@ struct s_smc *smc ; ...@@ -193,8 +188,7 @@ struct s_smc *smc ;
* The elapsed time since last start in units of 16us. * The elapsed time since last start in units of 16us.
* *
************************/ ************************/
u_long hwt_read(smc) u_long hwt_read(struct s_smc *smc)
struct s_smc *smc ;
{ {
u_short tr ; u_short tr ;
#ifndef PCI #ifndef PCI
...@@ -238,8 +232,7 @@ struct s_smc *smc ; ...@@ -238,8 +232,7 @@ struct s_smc *smc ;
* current timer value in units of 80ns. * current timer value in units of 80ns.
* *
************************/ ************************/
u_long hwt_quick_read(smc) u_long hwt_quick_read(struct s_smc *smc)
struct s_smc *smc ;
{ {
u_long interval ; u_long interval ;
u_long time ; u_long time ;
...@@ -267,10 +260,7 @@ struct s_smc *smc ; ...@@ -267,10 +260,7 @@ struct s_smc *smc ;
* NOTE: The fuction will return immediately, if the timer is not * NOTE: The fuction will return immediately, if the timer is not
* started * started
************************/ ************************/
void hwt_wait_time(smc,start,duration) void hwt_wait_time(struct s_smc *smc, u_long start, long int duration)
struct s_smc *smc ;
u_long start ;
long duration ;
{ {
long diff ; long diff ;
long interval ; long interval ;
...@@ -312,3 +302,4 @@ long duration ; ...@@ -312,3 +302,4 @@ long duration ;
} }
} }
#endif #endif
...@@ -52,8 +52,7 @@ Return smt_error_word These bits are supported: ...@@ -52,8 +52,7 @@ Return smt_error_word These bits are supported:
END_MANUAL_ENTRY() END_MANUAL_ENTRY()
*/ */
u_long smt_get_error_word(smc) u_long smt_get_error_word(struct s_smc *smc)
struct s_smc *smc ;
{ {
u_long st; u_long st;
...@@ -92,8 +91,7 @@ Return smt_event_word always 0 ...@@ -92,8 +91,7 @@ Return smt_event_word always 0
END_MANUAL_ENTRY() END_MANUAL_ENTRY()
*/ */
u_long smt_get_event_word(smc) u_long smt_get_event_word(struct s_smc *smc)
struct s_smc *smc ;
{ {
return (u_long) 0; return (u_long) 0;
} }
...@@ -111,8 +109,7 @@ Return smt_port_event_word always 0 ...@@ -111,8 +109,7 @@ Return smt_port_event_word always 0
END_MANUAL_ENTRY() END_MANUAL_ENTRY()
*/ */
u_long smt_get_port_event_word(smc) u_long smt_get_port_event_word(struct s_smc *smc)
struct s_smc *smc ;
{ {
return (u_long) 0; return (u_long) 0;
} }
...@@ -135,10 +132,7 @@ Return len used len of the error log field ...@@ -135,10 +132,7 @@ Return len used len of the error log field
END_MANUAL_ENTRY() END_MANUAL_ENTRY()
*/ */
int smt_read_errorlog(smc,p,len) int smt_read_errorlog(struct s_smc *smc, char _far *p, int len)
struct s_smc *smc ;
char _far *p ;
int len ;
{ {
int i ; int i ;
int st ; int st ;
...@@ -207,3 +201,4 @@ int len ; ...@@ -207,3 +201,4 @@ int len ;
er->ucode_version_level = 0x0101 ; er->ucode_version_level = 0x0101 ;
return(len) ; return(len) ;
} }
...@@ -199,28 +199,25 @@ static int plc_imsk_act = PL_PCM_CODE | PL_TRACE_PROP | PL_PCM_BREAK | ...@@ -199,28 +199,25 @@ static int plc_imsk_act = PL_PCM_CODE | PL_TRACE_PROP | PL_PCM_BREAK |
PL_PCM_ENABLED | PL_SELF_TEST | PL_EBUF_ERR; PL_PCM_ENABLED | PL_SELF_TEST | PL_EBUF_ERR;
/* external functions */ /* external functions */
void all_selection_criteria (); void all_selection_criteria(struct s_smc *smc);
/* internal functions */ /* internal functions */
static void pcm_fsm() ; static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd);
static void pc_rcode_actions() ; static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy);
static void pc_tcode_actions() ; static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy);
static void reset_lem_struct() ; static void reset_lem_struct(struct s_phy *phy);
static void plc_init() ; static void plc_init(struct s_smc *smc, int p);
static void sm_ph_lem_start() ; static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold);
static void sm_ph_lem_stop() ; static void sm_ph_lem_stop(struct s_smc *smc, int np);
static void sm_ph_linestate() ; static void sm_ph_linestate(struct s_smc *smc, int phy, int ls);
static void real_init_plc() ; static void real_init_plc(struct s_smc *smc);
/* /*
* SMT timer interface * SMT timer interface
* start PCM timer 0 * start PCM timer 0
*/ */
static void start_pcm_timer0(smc,value,event,phy) static void start_pcm_timer0(struct s_smc *smc, u_long value, int event,
struct s_smc *smc ; struct s_phy *phy)
u_long value;
int event;
struct s_phy *phy;
{ {
phy->timer0_exp = FALSE ; /* clear timer event flag */ phy->timer0_exp = FALSE ; /* clear timer event flag */
smt_timer_start(smc,&phy->pcm_timer0,value, smt_timer_start(smc,&phy->pcm_timer0,value,
...@@ -230,9 +227,7 @@ struct s_phy *phy; ...@@ -230,9 +227,7 @@ struct s_phy *phy;
* SMT timer interface * SMT timer interface
* stop PCM timer 0 * stop PCM timer 0
*/ */
static void stop_pcm_timer0(smc,phy) static void stop_pcm_timer0(struct s_smc *smc, struct s_phy *phy)
struct s_smc *smc ;
struct s_phy *phy;
{ {
if (phy->pcm_timer0.tm_active) if (phy->pcm_timer0.tm_active)
smt_timer_stop(smc,&phy->pcm_timer0) ; smt_timer_stop(smc,&phy->pcm_timer0) ;
...@@ -242,8 +237,7 @@ struct s_phy *phy; ...@@ -242,8 +237,7 @@ struct s_phy *phy;
init PCM state machine (called by driver) init PCM state machine (called by driver)
clear all PCM vars and flags clear all PCM vars and flags
*/ */
void pcm_init(smc) void pcm_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
int i ; int i ;
int np ; int np ;
...@@ -407,8 +401,7 @@ struct s_smc *smc ; ...@@ -407,8 +401,7 @@ struct s_smc *smc ;
real_init_plc(smc) ; real_init_plc(smc) ;
} }
void init_plc(smc) void init_plc(struct s_smc *smc)
struct s_smc *smc ;
{ {
SK_UNUSED(smc) ; SK_UNUSED(smc) ;
...@@ -421,8 +414,7 @@ struct s_smc *smc ; ...@@ -421,8 +414,7 @@ struct s_smc *smc ;
*/ */
} }
static void real_init_plc(smc) static void real_init_plc(struct s_smc *smc)
struct s_smc *smc ;
{ {
int p ; int p ;
...@@ -430,9 +422,7 @@ struct s_smc *smc ; ...@@ -430,9 +422,7 @@ struct s_smc *smc ;
plc_init(smc,p) ; plc_init(smc,p) ;
} }
static void plc_init(smc,p) static void plc_init(struct s_smc *smc, int p)
struct s_smc *smc ;
int p;
{ {
int i ; int i ;
#ifndef MOT_ELM #ifndef MOT_ELM
...@@ -495,10 +485,7 @@ int p; ...@@ -495,10 +485,7 @@ int p;
/* /*
* control PCM state machine * control PCM state machine
*/ */
static void plc_go_state(smc,p,state) static void plc_go_state(struct s_smc *smc, int p, int state)
struct s_smc *smc ;
int p;
int state;
{ {
HW_PTR port ; HW_PTR port ;
int val ; int val ;
...@@ -514,9 +501,7 @@ int state; ...@@ -514,9 +501,7 @@ int state;
/* /*
* read current line state (called by ECM & PCM) * read current line state (called by ECM & PCM)
*/ */
int sm_pm_get_ls(smc,phy) int sm_pm_get_ls(struct s_smc *smc, int phy)
struct s_smc *smc ;
int phy;
{ {
int state ; int state ;
...@@ -549,10 +534,7 @@ int phy; ...@@ -549,10 +534,7 @@ int phy;
return(state) ; return(state) ;
} }
static int plc_send_bits(smc,phy,len) static int plc_send_bits(struct s_smc *smc, struct s_phy *phy, int len)
struct s_smc *smc ;
struct s_phy *phy;
int len;
{ {
int np = phy->np ; /* PHY index */ int np = phy->np ; /* PHY index */
int n ; int n ;
...@@ -589,9 +571,7 @@ int len; ...@@ -589,9 +571,7 @@ int len;
/* /*
* config plc muxes * config plc muxes
*/ */
void plc_config_mux(smc,mux) void plc_config_mux(struct s_smc *smc, int mux)
struct s_smc *smc ;
int mux ;
{ {
if (smc->s.sas != SMT_DAS) if (smc->s.sas != SMT_DAS)
return ; return ;
...@@ -615,10 +595,7 @@ int mux ; ...@@ -615,10 +595,7 @@ int mux ;
process event process event
until SM is stable until SM is stable
*/ */
void pcm(smc,np,event) void pcm(struct s_smc *smc, const int np, int event)
struct s_smc *smc ;
const int np;
int event;
{ {
int state ; int state ;
int oldstate ; int oldstate ;
...@@ -697,10 +674,7 @@ int event; ...@@ -697,10 +674,7 @@ int event;
/* /*
* PCM state machine * PCM state machine
*/ */
static void pcm_fsm(smc,phy,cmd) static void pcm_fsm(struct s_smc *smc, struct s_phy *phy, int cmd)
struct s_smc *smc ;
struct s_phy *phy;
int cmd;
{ {
int i ; int i ;
int np = phy->np ; /* PHY index */ int np = phy->np ; /* PHY index */
...@@ -1063,10 +1037,7 @@ int cmd; ...@@ -1063,10 +1037,7 @@ int cmd;
/* /*
* force line state on a PHY output (only in MAINT state) * force line state on a PHY output (only in MAINT state)
*/ */
static void sm_ph_linestate(smc,phy,ls) static void sm_ph_linestate(struct s_smc *smc, int phy, int ls)
struct s_smc *smc ;
int phy;
int ls;
{ {
int cntrl ; int cntrl ;
...@@ -1095,9 +1066,7 @@ int ls; ...@@ -1095,9 +1066,7 @@ int ls;
outpw(PLC(phy,PL_CNTRL_B),cntrl) ; outpw(PLC(phy,PL_CNTRL_B),cntrl) ;
} }
static void reset_lem_struct(struct s_phy *phy)
static void reset_lem_struct(phy)
struct s_phy *phy;
{ {
struct lem_counter *lem = &phy->lem ; struct lem_counter *lem = &phy->lem ;
...@@ -1108,9 +1077,7 @@ struct s_phy *phy; ...@@ -1108,9 +1077,7 @@ struct s_phy *phy;
/* /*
* link error monitor * link error monitor
*/ */
static void lem_evaluate(smc,phy) static void lem_evaluate(struct s_smc *smc, struct s_phy *phy)
struct s_smc *smc ;
struct s_phy *phy;
{ {
int ber ; int ber ;
u_long errors ; u_long errors ;
...@@ -1210,8 +1177,7 @@ struct s_phy *phy; ...@@ -1210,8 +1177,7 @@ struct s_phy *phy;
/* /*
* called by SMT to calculate LEM bit error rate * called by SMT to calculate LEM bit error rate
*/ */
void sm_lem_evaluate(smc) void sm_lem_evaluate(struct s_smc *smc)
struct s_smc *smc ;
{ {
int np ; int np ;
...@@ -1219,9 +1185,7 @@ struct s_smc *smc ; ...@@ -1219,9 +1185,7 @@ struct s_smc *smc ;
lem_evaluate(smc,&smc->y[np]) ; lem_evaluate(smc,&smc->y[np]) ;
} }
static void lem_check_lct(smc,phy) static void lem_check_lct(struct s_smc *smc, struct s_phy *phy)
struct s_smc *smc ;
struct s_phy *phy ;
{ {
struct lem_counter *lem = &phy->lem ; struct lem_counter *lem = &phy->lem ;
struct fddi_mib_p *mib ; struct fddi_mib_p *mib ;
...@@ -1265,10 +1229,7 @@ struct s_phy *phy ; ...@@ -1265,10 +1229,7 @@ struct s_phy *phy ;
/* /*
* LEM functions * LEM functions
*/ */
static void sm_ph_lem_start(smc,np,threshold) static void sm_ph_lem_start(struct s_smc *smc, int np, int threshold)
struct s_smc *smc ;
int np;
int threshold;
{ {
struct lem_counter *lem = &smc->y[np].lem ; struct lem_counter *lem = &smc->y[np].lem ;
...@@ -1286,9 +1247,7 @@ int threshold; ...@@ -1286,9 +1247,7 @@ int threshold;
SETMASK(PLC(np,PL_INTR_MASK),PL_LE_CTR,PL_LE_CTR) ; SETMASK(PLC(np,PL_INTR_MASK),PL_LE_CTR,PL_LE_CTR) ;
} }
static void sm_ph_lem_stop(smc,np) static void sm_ph_lem_stop(struct s_smc *smc, int np)
struct s_smc *smc ;
int np;
{ {
struct lem_counter *lem = &smc->y[np].lem ; struct lem_counter *lem = &smc->y[np].lem ;
...@@ -1297,10 +1256,8 @@ int np; ...@@ -1297,10 +1256,8 @@ int np;
} }
/* ARGSUSED */ /* ARGSUSED */
void sm_pm_ls_latch(smc,phy,on_off) void sm_pm_ls_latch(struct s_smc *smc, int phy, int on_off)
struct s_smc *smc ; /* int on_off; en- or disable ident. ls */
int phy;
int on_off; /* en- or disable ident. ls */
{ {
SK_UNUSED(smc) ; SK_UNUSED(smc) ;
...@@ -1317,10 +1274,7 @@ int on_off; /* en- or disable ident. ls */ ...@@ -1317,10 +1274,7 @@ int on_off; /* en- or disable ident. ls */
/* /*
* PCM pseudo code 5.1 .. 6.1 * PCM pseudo code 5.1 .. 6.1
*/ */
static void pc_rcode_actions(smc,bit,phy) static void pc_rcode_actions(struct s_smc *smc, int bit, struct s_phy *phy)
struct s_smc *smc ;
int bit;
struct s_phy *phy;
{ {
struct fddi_mib_p *mib ; struct fddi_mib_p *mib ;
...@@ -1456,10 +1410,7 @@ struct s_phy *phy; ...@@ -1456,10 +1410,7 @@ struct s_phy *phy;
/* /*
* PCM pseudo code 5.1 .. 6.1 * PCM pseudo code 5.1 .. 6.1
*/ */
static void pc_tcode_actions(smc,bit,phy) static void pc_tcode_actions(struct s_smc *smc, const int bit, struct s_phy *phy)
struct s_smc *smc ;
const int bit;
struct s_phy *phy;
{ {
int np = phy->np ; int np = phy->np ;
struct fddi_mib_p *mib ; struct fddi_mib_p *mib ;
...@@ -1638,8 +1589,7 @@ struct s_phy *phy; ...@@ -1638,8 +1589,7 @@ struct s_phy *phy;
/* /*
* return status twisted (called by SMT) * return status twisted (called by SMT)
*/ */
int pcm_status_twisted(smc) int pcm_status_twisted(struct s_smc *smc)
struct s_smc *smc ;
{ {
int twist = 0 ; int twist = 0 ;
if (smc->s.sas != SMT_DAS) if (smc->s.sas != SMT_DAS)
...@@ -1658,13 +1608,8 @@ struct s_smc *smc ; ...@@ -1658,13 +1608,8 @@ struct s_smc *smc ;
* remote phy type * remote phy type
* remote mac yes/no * remote mac yes/no
*/ */
void pcm_status_state(smc,np,type,state,remote,mac) void pcm_status_state(struct s_smc *smc, int np, int *type, int *state,
struct s_smc *smc ; int *remote, int *mac)
int np;
int *type;
int *state;
int *remote;
int *mac;
{ {
struct s_phy *phy = &smc->y[np] ; struct s_phy *phy = &smc->y[np] ;
struct fddi_mib_p *mib ; struct fddi_mib_p *mib ;
...@@ -1687,8 +1632,7 @@ int *mac; ...@@ -1687,8 +1632,7 @@ int *mac;
/* /*
* return rooted station status (called by SMT) * return rooted station status (called by SMT)
*/ */
int pcm_rooted_station(smc) int pcm_rooted_station(struct s_smc *smc)
struct s_smc *smc ;
{ {
int n ; int n ;
...@@ -1703,10 +1647,8 @@ struct s_smc *smc ; ...@@ -1703,10 +1647,8 @@ struct s_smc *smc ;
/* /*
* Interrupt actions for PLC & PCM events * Interrupt actions for PLC & PCM events
*/ */
void plc_irq(smc,np,cmd) void plc_irq(struct s_smc *smc, int np, unsigned int cmd)
struct s_smc *smc ; /* int np; PHY index */
int np; /* PHY index */
unsigned int cmd;
{ {
struct s_phy *phy = &smc->y[np] ; struct s_phy *phy = &smc->y[np] ;
struct s_plc *plc = &phy->plc ; struct s_plc *plc = &phy->plc ;
...@@ -1919,9 +1861,7 @@ unsigned int cmd; ...@@ -1919,9 +1861,7 @@ unsigned int cmd;
#endif #endif
} }
void pcm_set_lct_short(smc,n) void pcm_set_lct_short(struct s_smc *smc, int n)
struct s_smc *smc ;
int n ;
{ {
if (n <= 0 || n > 1000) if (n <= 0 || n > 1000)
return ; return ;
...@@ -1932,9 +1872,7 @@ int n ; ...@@ -1932,9 +1872,7 @@ int n ;
/* /*
* fill state struct * fill state struct
*/ */
void pcm_get_state(smc,state) void pcm_get_state(struct s_smc *smc, struct smt_state *state)
struct s_smc *smc ;
struct smt_state *state ;
{ {
struct s_phy *phy ; struct s_phy *phy ;
struct pcm_state *pcs ; struct pcm_state *pcs ;
...@@ -1968,9 +1906,7 @@ struct smt_state *state ; ...@@ -1968,9 +1906,7 @@ struct smt_state *state ;
} }
} }
int get_pcm_state(smc,np) int get_pcm_state(struct s_smc *smc, int np)
struct s_smc *smc ;
int np;
{ {
int pcs ; int pcs ;
...@@ -1992,9 +1928,7 @@ int np; ...@@ -1992,9 +1928,7 @@ int np;
return(pcs) ; return(pcs) ;
} }
char *get_linestate(smc,np) char *get_linestate(struct s_smc *smc, int np)
struct s_smc *smc ;
int np;
{ {
char *ls = "" ; char *ls = "" ;
...@@ -2016,9 +1950,7 @@ int np; ...@@ -2016,9 +1950,7 @@ int np;
return(ls) ; return(ls) ;
} }
char *get_pcmstate(smc,np) char *get_pcmstate(struct s_smc *smc, int np)
struct s_smc *smc ;
int np;
{ {
char *pcs ; char *pcs ;
...@@ -2040,8 +1972,7 @@ int np; ...@@ -2040,8 +1972,7 @@ int np;
return(pcs) ; return(pcs) ;
} }
void list_phy(smc) void list_phy(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct s_plc *plc ; struct s_plc *plc ;
int np ; int np ;
...@@ -2069,8 +2000,7 @@ struct s_smc *smc ; ...@@ -2069,8 +2000,7 @@ struct s_smc *smc ;
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
void pcm_lem_dump(smc) void pcm_lem_dump(struct s_smc *smc)
struct s_smc *smc ;
{ {
int i ; int i ;
struct s_phy *phy ; struct s_phy *phy ;
......
...@@ -32,12 +32,16 @@ ...@@ -32,12 +32,16 @@
static const char ID_sccs[] = "@(#)pmf.c 1.37 97/08/04 (C) SK " ; static const char ID_sccs[] = "@(#)pmf.c 1.37 97/08/04 (C) SK " ;
#endif #endif
static int smt_authorize() ; static int smt_authorize(struct s_smc *smc, struct smt_header *sm);
static int smt_check_set_count() ; static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm);
static const struct s_p_tab *smt_get_ptab() ; static const struct s_p_tab* smt_get_ptab(u_short para);
static int smt_mib_phys() ; static int smt_mib_phys(struct s_smc *smc);
int smt_set_para() ; int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, int local,
void smt_add_para() ; int set);
void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
int index, int local);
static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
int set, int local);
#define MOFFSS(e) ((int)&(((struct fddi_mib *)0)->e)) #define MOFFSS(e) ((int)&(((struct fddi_mib *)0)->e))
#define MOFFSA(e) ((int) (((struct fddi_mib *)0)->e)) #define MOFFSA(e) ((int) (((struct fddi_mib *)0)->e))
...@@ -280,13 +284,7 @@ static const struct s_p_tab { ...@@ -280,13 +284,7 @@ static const struct s_p_tab {
{ 0 } { 0 }
} ; } ;
void smt_pmf_received_pack(struct s_smc *smc, SMbuf *mb, int local)
static SMbuf *smt_build_pmf_response() ;
void smt_pmf_received_pack(smc,mb,local)
struct s_smc *smc ;
SMbuf *mb ;
int local ;
{ {
struct smt_header *sm ; struct smt_header *sm ;
SMbuf *reply ; SMbuf *reply ;
...@@ -316,13 +314,8 @@ int local ; ...@@ -316,13 +314,8 @@ int local ;
} }
} }
extern SMbuf *smt_get_mbuf() ; static SMbuf *smt_build_pmf_response(struct s_smc *smc, struct smt_header *req,
int set, int local)
static SMbuf *smt_build_pmf_response(smc,req,set,local)
struct s_smc *smc ;
struct smt_header *req ;
int set ;
int local ;
{ {
SMbuf *mb ; SMbuf *mb ;
struct smt_header *smt ; struct smt_header *smt ;
...@@ -509,11 +502,7 @@ int local ; ...@@ -509,11 +502,7 @@ int local ;
return(mb) ; return(mb) ;
} }
extern void *sm_to_para() ; static int smt_authorize(struct s_smc *smc, struct smt_header *sm)
static int smt_authorize(smc,sm)
struct s_smc *smc ;
struct smt_header *sm ;
{ {
struct smt_para *pa ; struct smt_para *pa ;
int i ; int i ;
...@@ -548,9 +537,7 @@ struct smt_header *sm ; ...@@ -548,9 +537,7 @@ struct smt_header *sm ;
return(0) ; return(0) ;
} }
static int smt_check_set_count(smc,sm) static int smt_check_set_count(struct s_smc *smc, struct smt_header *sm)
struct s_smc *smc ;
struct smt_header *sm ;
{ {
struct smt_para *pa ; struct smt_para *pa ;
struct smt_p_setcount *sc ; struct smt_p_setcount *sc ;
...@@ -566,12 +553,8 @@ struct smt_header *sm ; ...@@ -566,12 +553,8 @@ struct smt_header *sm ;
return(0) ; return(0) ;
} }
void smt_add_para(smc,pcon,para,index,local) void smt_add_para(struct s_smc *smc, struct s_pcon *pcon, u_short para,
struct s_smc *smc ; int index, int local)
struct s_pcon *pcon ;
u_short para ;
int index ;
int local ;
{ {
struct smt_para *pa ; struct smt_para *pa ;
const struct s_p_tab *pt ; const struct s_p_tab *pt ;
...@@ -1095,12 +1078,8 @@ int local ; ...@@ -1095,12 +1078,8 @@ int local ;
/* /*
* set parameter * set parameter
*/ */
int smt_set_para(smc,pa,index,local,set) int smt_set_para(struct s_smc *smc, struct smt_para *pa, int index, int local,
struct s_smc *smc ; int set)
struct smt_para *pa ;
int index ;
int local ;
int set ;
{ {
#define IFSET(x) if (set) (x) #define IFSET(x) if (set) (x)
...@@ -1549,8 +1528,7 @@ int set ; ...@@ -1549,8 +1528,7 @@ int set ;
#endif #endif
} }
static const struct s_p_tab *smt_get_ptab(para) static const struct s_p_tab *smt_get_ptab(u_short para)
u_short para ;
{ {
const struct s_p_tab *pt ; const struct s_p_tab *pt ;
for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++) for (pt = p_tab ; pt->p_num && pt->p_num != para ; pt++)
...@@ -1558,8 +1536,7 @@ u_short para ; ...@@ -1558,8 +1536,7 @@ u_short para ;
return(pt->p_num ? pt : 0) ; return(pt->p_num ? pt : 0) ;
} }
static int smt_mib_phys(smc) static int smt_mib_phys(struct s_smc *smc)
struct s_smc *smc ;
{ {
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
SK_UNUSED(smc) ; SK_UNUSED(smc) ;
...@@ -1572,9 +1549,7 @@ struct s_smc *smc ; ...@@ -1572,9 +1549,7 @@ struct s_smc *smc ;
#endif #endif
} }
int port_to_mib(smc,p) int port_to_mib(struct s_smc *smc, int p)
struct s_smc *smc ;
int p ;
{ {
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
SK_UNUSED(smc) ; SK_UNUSED(smc) ;
...@@ -1590,10 +1565,7 @@ int p ; ...@@ -1590,10 +1565,7 @@ int p ;
#ifdef DEBUG #ifdef DEBUG
#ifndef BOOT #ifndef BOOT
void dump_smt(smc,sm,text) void dump_smt(struct s_smc *smc, struct smt_header *sm, char *text)
struct s_smc *smc ;
struct smt_header *sm ;
char *text ;
{ {
int len ; int len ;
struct smt_para *pa ; struct smt_para *pa ;
...@@ -1680,9 +1652,7 @@ char *text ; ...@@ -1680,9 +1652,7 @@ char *text ;
printf("-------------------------------------------------\n\n") ; printf("-------------------------------------------------\n\n") ;
} }
void dump_hex(p,len) void dump_hex(char *p, int len)
char *p ;
int len ;
{ {
int n = 0 ; int n = 0 ;
while (len--) { while (len--) {
......
...@@ -31,8 +31,7 @@ static const char ID_sccs[] = "@(#)queue.c 2.9 97/08/04 (C) SK " ; ...@@ -31,8 +31,7 @@ static const char ID_sccs[] = "@(#)queue.c 2.9 97/08/04 (C) SK " ;
/* /*
* init event queue management * init event queue management
*/ */
void ev_init(smc) void ev_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->q.ev_put = smc->q.ev_get = smc->q.ev_queue ; smc->q.ev_put = smc->q.ev_get = smc->q.ev_queue ;
} }
...@@ -40,10 +39,7 @@ struct s_smc *smc ; ...@@ -40,10 +39,7 @@ struct s_smc *smc ;
/* /*
* add event to queue * add event to queue
*/ */
void queue_event(smc,class,event) void queue_event(struct s_smc *smc, int class, int event)
struct s_smc *smc ;
int class ;
int event ;
{ {
PRINTF("queue class %d event %d\n",class,event) ; PRINTF("queue class %d event %d\n",class,event) ;
smc->q.ev_put->class = class ; smc->q.ev_put->class = class ;
...@@ -59,9 +55,7 @@ int event ; ...@@ -59,9 +55,7 @@ int event ;
/* /*
* timer_event is called from HW timer package. * timer_event is called from HW timer package.
*/ */
void timer_event(smc,token) void timer_event(struct s_smc *smc, u_long token)
struct s_smc *smc ;
u_long token ;
{ {
PRINTF("timer event class %d token %d\n", PRINTF("timer event class %d token %d\n",
EV_T_CLASS(token), EV_T_CLASS(token),
...@@ -76,8 +70,7 @@ u_long token ; ...@@ -76,8 +70,7 @@ u_long token ;
* send command to state machine * send command to state machine
* end * end
*/ */
void ev_dispatcher(smc) void ev_dispatcher(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct event_queue *ev ; /* pointer into queue */ struct event_queue *ev ; /* pointer into queue */
int class ; int class ;
...@@ -131,9 +124,7 @@ struct s_smc *smc ; ...@@ -131,9 +124,7 @@ struct s_smc *smc ;
* on 0 disconnect * on 0 disconnect
* on 1 connect * on 1 connect
*/ */
u_short smt_online(smc,on) u_short smt_online(struct s_smc *smc, int on)
struct s_smc *smc ;
int on ;
{ {
queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ; queue_event(smc,EVENT_ECM,on ? EC_CONNECT : EC_DISCONNECT) ;
ev_dispatcher(smc) ; ev_dispatcher(smc) ;
...@@ -147,10 +138,7 @@ int on ; ...@@ -147,10 +138,7 @@ int on ;
* dump current flag setting * dump current flag setting
*/ */
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
void do_smt_flag(smc,flag,value) void do_smt_flag(struct s_smc *smc, char *flag, int value)
struct s_smc *smc ;
char *flag ;
int value ;
{ {
#ifdef DEBUG #ifdef DEBUG
struct smt_debug *deb; struct smt_debug *deb;
......
...@@ -102,17 +102,17 @@ static const char * const rmt_events[] = { ...@@ -102,17 +102,17 @@ static const char * const rmt_events[] = {
/* /*
* function declarations * function declarations
*/ */
static void rmt_fsm() ; static void rmt_fsm(struct s_smc *smc, int cmd);
static void start_rmt_timer0() ; static void start_rmt_timer0(struct s_smc *smc, u_long value, int event);
static void start_rmt_timer1() ; static void start_rmt_timer1(struct s_smc *smc, u_long value, int event);
static void start_rmt_timer2() ; static void start_rmt_timer2(struct s_smc *smc, u_long value, int event);
static void stop_rmt_timer0() ; static void stop_rmt_timer0(struct s_smc *smc);
static void stop_rmt_timer1() ; static void stop_rmt_timer1(struct s_smc *smc);
static void stop_rmt_timer2() ; static void stop_rmt_timer2(struct s_smc *smc);
static void rmt_dup_actions() ; static void rmt_dup_actions(struct s_smc *smc);
static void rmt_reinsert_actions() ; static void rmt_reinsert_actions(struct s_smc *smc);
static void rmt_leave_actions() ; static void rmt_leave_actions(struct s_smc *smc);
static void rmt_new_dup_actions() ; static void rmt_new_dup_actions(struct s_smc *smc);
#ifndef SUPERNET_3 #ifndef SUPERNET_3
extern void restart_trt_for_dbcn() ; extern void restart_trt_for_dbcn() ;
...@@ -122,8 +122,7 @@ extern void restart_trt_for_dbcn() ; ...@@ -122,8 +122,7 @@ extern void restart_trt_for_dbcn() ;
init RMT state machine init RMT state machine
clear all RMT vars and flags clear all RMT vars and flags
*/ */
void rmt_init(smc) void rmt_init(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->mib.m[MAC0].fddiMACRMTState = ACTIONS(RM0_ISOLATED) ; smc->mib.m[MAC0].fddiMACRMTState = ACTIONS(RM0_ISOLATED) ;
smc->r.dup_addr_test = DA_NONE ; smc->r.dup_addr_test = DA_NONE ;
...@@ -145,9 +144,7 @@ struct s_smc *smc ; ...@@ -145,9 +144,7 @@ struct s_smc *smc ;
process event process event
until SM is stable until SM is stable
*/ */
void rmt(smc,event) void rmt(struct s_smc *smc, int event)
struct s_smc *smc ;
int event ;
{ {
int state ; int state ;
...@@ -166,9 +163,7 @@ int event ; ...@@ -166,9 +163,7 @@ int event ;
/* /*
process RMT event process RMT event
*/ */
static void rmt_fsm(smc,cmd) static void rmt_fsm(struct s_smc *smc, int cmd)
struct s_smc *smc ;
int cmd ;
{ {
/* /*
* RM00-RM70 : from all states * RM00-RM70 : from all states
...@@ -535,8 +530,7 @@ int cmd ; ...@@ -535,8 +530,7 @@ int cmd ;
* (jd) RMT duplicate address actions * (jd) RMT duplicate address actions
* leave the ring or reinsert just as configured * leave the ring or reinsert just as configured
*/ */
static void rmt_dup_actions(smc) static void rmt_dup_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
if (smc->r.jm_flag) { if (smc->r.jm_flag) {
} }
...@@ -555,8 +549,7 @@ struct s_smc *smc ; ...@@ -555,8 +549,7 @@ struct s_smc *smc ;
/* /*
* Reconnect to the Ring * Reconnect to the Ring
*/ */
static void rmt_reinsert_actions(smc) static void rmt_reinsert_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
queue_event(smc,EVENT_ECM,EC_DISCONNECT) ; queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
queue_event(smc,EVENT_ECM,EC_CONNECT) ; queue_event(smc,EVENT_ECM,EC_CONNECT) ;
...@@ -565,8 +558,7 @@ struct s_smc *smc ; ...@@ -565,8 +558,7 @@ struct s_smc *smc ;
/* /*
* duplicate address detected * duplicate address detected
*/ */
static void rmt_new_dup_actions(smc) static void rmt_new_dup_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
smc->r.da_flag = TRUE ; smc->r.da_flag = TRUE ;
smc->r.bn_flag = FALSE ; smc->r.bn_flag = FALSE ;
...@@ -591,8 +583,7 @@ struct s_smc *smc ; ...@@ -591,8 +583,7 @@ struct s_smc *smc ;
/* /*
* leave the ring * leave the ring
*/ */
static void rmt_leave_actions(smc) static void rmt_leave_actions(struct s_smc *smc)
struct s_smc *smc ;
{ {
queue_event(smc,EVENT_ECM,EC_DISCONNECT) ; queue_event(smc,EVENT_ECM,EC_DISCONNECT) ;
/* /*
...@@ -605,10 +596,7 @@ struct s_smc *smc ; ...@@ -605,10 +596,7 @@ struct s_smc *smc ;
* SMT timer interface * SMT timer interface
* start RMT timer 0 * start RMT timer 0
*/ */
static void start_rmt_timer0(smc,value,event) static void start_rmt_timer0(struct s_smc *smc, u_long value, int event)
struct s_smc *smc ;
u_long value ;
int event ;
{ {
smc->r.timer0_exp = FALSE ; /* clear timer event flag */ smc->r.timer0_exp = FALSE ; /* clear timer event flag */
smt_timer_start(smc,&smc->r.rmt_timer0,value,EV_TOKEN(EVENT_RMT,event)); smt_timer_start(smc,&smc->r.rmt_timer0,value,EV_TOKEN(EVENT_RMT,event));
...@@ -618,10 +606,7 @@ int event ; ...@@ -618,10 +606,7 @@ int event ;
* SMT timer interface * SMT timer interface
* start RMT timer 1 * start RMT timer 1
*/ */
static void start_rmt_timer1(smc,value,event) static void start_rmt_timer1(struct s_smc *smc, u_long value, int event)
struct s_smc *smc ;
u_long value ;
int event ;
{ {
smc->r.timer1_exp = FALSE ; /* clear timer event flag */ smc->r.timer1_exp = FALSE ; /* clear timer event flag */
smt_timer_start(smc,&smc->r.rmt_timer1,value,EV_TOKEN(EVENT_RMT,event)); smt_timer_start(smc,&smc->r.rmt_timer1,value,EV_TOKEN(EVENT_RMT,event));
...@@ -631,10 +616,7 @@ int event ; ...@@ -631,10 +616,7 @@ int event ;
* SMT timer interface * SMT timer interface
* start RMT timer 2 * start RMT timer 2
*/ */
static void start_rmt_timer2(smc,value,event) static void start_rmt_timer2(struct s_smc *smc, u_long value, int event)
struct s_smc *smc ;
u_long value ;
int event ;
{ {
smc->r.timer2_exp = FALSE ; /* clear timer event flag */ smc->r.timer2_exp = FALSE ; /* clear timer event flag */
smt_timer_start(smc,&smc->r.rmt_timer2,value,EV_TOKEN(EVENT_RMT,event)); smt_timer_start(smc,&smc->r.rmt_timer2,value,EV_TOKEN(EVENT_RMT,event));
...@@ -644,8 +626,7 @@ int event ; ...@@ -644,8 +626,7 @@ int event ;
* SMT timer interface * SMT timer interface
* stop RMT timer 0 * stop RMT timer 0
*/ */
static void stop_rmt_timer0(smc) static void stop_rmt_timer0(struct s_smc *smc)
struct s_smc *smc ;
{ {
if (smc->r.rmt_timer0.tm_active) if (smc->r.rmt_timer0.tm_active)
smt_timer_stop(smc,&smc->r.rmt_timer0) ; smt_timer_stop(smc,&smc->r.rmt_timer0) ;
...@@ -655,8 +636,7 @@ struct s_smc *smc ; ...@@ -655,8 +636,7 @@ struct s_smc *smc ;
* SMT timer interface * SMT timer interface
* stop RMT timer 1 * stop RMT timer 1
*/ */
static void stop_rmt_timer1(smc) static void stop_rmt_timer1(struct s_smc *smc)
struct s_smc *smc ;
{ {
if (smc->r.rmt_timer1.tm_active) if (smc->r.rmt_timer1.tm_active)
smt_timer_stop(smc,&smc->r.rmt_timer1) ; smt_timer_stop(smc,&smc->r.rmt_timer1) ;
...@@ -666,9 +646,9 @@ struct s_smc *smc ; ...@@ -666,9 +646,9 @@ struct s_smc *smc ;
* SMT timer interface * SMT timer interface
* stop RMT timer 2 * stop RMT timer 2
*/ */
static void stop_rmt_timer2(smc) static void stop_rmt_timer2(struct s_smc *smc)
struct s_smc *smc ;
{ {
if (smc->r.rmt_timer2.tm_active) if (smc->r.rmt_timer2.tm_active)
smt_timer_stop(smc,&smc->r.rmt_timer2) ; smt_timer_stop(smc,&smc->r.rmt_timer2) ;
} }
...@@ -131,20 +131,10 @@ void mac_drv_clear_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd, ...@@ -131,20 +131,10 @@ void mac_drv_clear_rxd(struct s_smc *smc, volatile struct s_smt_fp_rxd *rxd,
int frag_count); int frag_count);
int mac_drv_rx_init(struct s_smc *smc, int len, int fc, char *look_ahead, int mac_drv_rx_init(struct s_smc *smc, int len, int fc, char *look_ahead,
int la_len); int la_len);
void smt_timer_poll(struct s_smc *smc);
void ring_status_indication(struct s_smc *smc, u_long status);
unsigned long smt_get_time(void);
void smt_stat_counter(struct s_smc *smc, int stat);
void cfm_state_change(struct s_smc *smc, int c_state);
void ecm_state_change(struct s_smc *smc, int e_state);
void pcm_state_change(struct s_smc *smc, int plc, int p_state);
void rmt_state_change(struct s_smc *smc, int r_state);
void drv_reset_indication(struct s_smc *smc);
void dump_data(unsigned char *Data, int length); void dump_data(unsigned char *Data, int length);
// External functions from the hardware module // External functions from the hardware module
extern u_int mac_drv_check_space(); extern u_int mac_drv_check_space(void);
extern void read_address(struct s_smc *smc, u_char * mac_addr); extern void read_address(struct s_smc *smc, u_char * mac_addr);
extern void card_stop(struct s_smc *smc); extern void card_stop(struct s_smc *smc);
extern int mac_drv_init(struct s_smc *smc); extern int mac_drv_init(struct s_smc *smc);
...@@ -157,9 +147,7 @@ extern void fddi_isr(struct s_smc *smc); ...@@ -157,9 +147,7 @@ extern void fddi_isr(struct s_smc *smc);
extern void hwm_rx_frag(struct s_smc *smc, char far * virt, u_long phys, extern void hwm_rx_frag(struct s_smc *smc, char far * virt, u_long phys,
int len, int frame_status); int len, int frame_status);
extern void mac_drv_rx_mode(struct s_smc *smc, int mode); extern void mac_drv_rx_mode(struct s_smc *smc, int mode);
extern void mac_drv_clear_tx_queue(struct s_smc *smc);
extern void mac_drv_clear_rx_queue(struct s_smc *smc); extern void mac_drv_clear_rx_queue(struct s_smc *smc);
extern void mac_clear_multicast(struct s_smc *smc);
extern void enable_tx_irq(struct s_smc *smc, u_short queue); extern void enable_tx_irq(struct s_smc *smc, u_short queue);
extern void mac_drv_clear_txd(struct s_smc *smc); extern void mac_drv_clear_txd(struct s_smc *smc);
...@@ -921,8 +909,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev) ...@@ -921,8 +909,7 @@ static void skfp_ctl_set_multicast_list_wo_lock(struct net_device *dev)
dmi = dev->mc_list; dmi = dev->mc_list;
for (i = 0; i < dev->mc_count; i++) { for (i = 0; i < dev->mc_count; i++) {
mac_add_multicast(smc, mac_add_multicast(smc, dmi->dmi_addr, 1);
dmi->dmi_addr, 1);
PRINTK(KERN_INFO "ENABLE MC ADDRESS:"); PRINTK(KERN_INFO "ENABLE MC ADDRESS:");
PRINTK(" %02x %02x %02x ", PRINTK(" %02x %02x %02x ",
dmi->dmi_addr[0], dmi->dmi_addr[0],
......
This diff is collapsed.
...@@ -72,13 +72,11 @@ static const char ID_sccs[] = "@(#)smtdef.c 2.53 99/08/11 (C) SK " ; ...@@ -72,13 +72,11 @@ static const char ID_sccs[] = "@(#)smtdef.c 2.53 99/08/11 (C) SK " ;
#define DEFAULT_LCT_EXTEND 50 #define DEFAULT_LCT_EXTEND 50
/* Forward declarations */ /* Forward declarations */
extern void smt_reset_defaults (); void smt_reset_defaults(struct s_smc *smc, int level);
static void smt_init_mib (); static void smt_init_mib(struct s_smc *smc, int level);
static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper);
static int set_min_max() ; void smt_set_defaults(struct s_smc *smc)
void smt_set_defaults(smc)
struct s_smc *smc ;
{ {
smt_reset_defaults(smc,0) ; smt_reset_defaults(smc,0) ;
} }
...@@ -86,9 +84,7 @@ struct s_smc *smc ; ...@@ -86,9 +84,7 @@ struct s_smc *smc ;
#define MS2BCLK(x) ((x)*12500L) #define MS2BCLK(x) ((x)*12500L)
#define US2BCLK(x) ((x)*1250L) #define US2BCLK(x) ((x)*1250L)
void smt_reset_defaults(smc,level) void smt_reset_defaults(struct s_smc *smc, int level)
struct s_smc *smc ;
int level ;
{ {
struct smt_config *smt ; struct smt_config *smt ;
int i ; int i ;
...@@ -170,9 +166,7 @@ static const char man_data[32] = ...@@ -170,9 +166,7 @@ static const char man_data[32] =
/* 01234567890123456789012345678901 */ /* 01234567890123456789012345678901 */
"xxxSK-NET FDDI SMT 7.3 - V2.8.8" ; "xxxSK-NET FDDI SMT 7.3 - V2.8.8" ;
static void smt_init_mib(smc,level) static void smt_init_mib(struct s_smc *smc, int level)
struct s_smc *smc ;
int level ;
{ {
struct fddi_mib *mib ; struct fddi_mib *mib ;
struct fddi_mib_p *pm ; struct fddi_mib_p *pm ;
...@@ -292,8 +286,7 @@ int level ; ...@@ -292,8 +286,7 @@ int level ;
(void) smt_set_mac_opvalues(smc) ; (void) smt_set_mac_opvalues(smc) ;
} }
int smt_set_mac_opvalues(smc) int smt_set_mac_opvalues(struct s_smc *smc)
struct s_smc *smc ;
{ {
int st ; int st ;
int st2 ; int st2 ;
...@@ -318,8 +311,7 @@ struct s_smc *smc ; ...@@ -318,8 +311,7 @@ struct s_smc *smc ;
return(st) ; return(st) ;
} }
void smt_fixup_mib(smc) void smt_fixup_mib(struct s_smc *smc)
struct s_smc *smc ;
{ {
#ifdef CONCENTRATOR #ifdef CONCENTRATOR
switch (smc->s.sas) { switch (smc->s.sas) {
...@@ -355,11 +347,7 @@ struct s_smc *smc ; ...@@ -355,11 +347,7 @@ struct s_smc *smc ;
* use mib * use mib
* NOTE : numbers are negative, negate comparison ! * NOTE : numbers are negative, negate comparison !
*/ */
static int set_min_max(maxflag,mib,limit,oper) static int set_min_max(int maxflag, u_long mib, u_long limit, u_long *oper)
int maxflag ;
u_long mib ;
u_long limit ;
u_long *oper ;
{ {
u_long old ; u_long old ;
old = *oper ; old = *oper ;
...@@ -369,3 +357,4 @@ u_long *oper ; ...@@ -369,3 +357,4 @@ u_long *oper ;
*oper = mib ; *oper = mib ;
return(old != *oper) ; return(old != *oper) ;
} }
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
static const char ID_sccs[] = "@(#)smtinit.c 1.15 97/05/06 (C) SK " ; static const char ID_sccs[] = "@(#)smtinit.c 1.15 97/05/06 (C) SK " ;
#endif #endif
extern void init_fddi_driver() ; void init_fddi_driver(struct s_smc *smc, u_char *mac_addr);
/* define global debug variable */ /* define global debug variable */
#if defined(DEBUG) && !defined(DEBUG_BRD) #if defined(DEBUG) && !defined(DEBUG_BRD)
...@@ -48,8 +48,7 @@ struct smt_debug debug; ...@@ -48,8 +48,7 @@ struct smt_debug debug;
* Can not be called in smt_reset_defaults, because it is not sure that * Can not be called in smt_reset_defaults, because it is not sure that
* the OEM ID is already defined. * the OEM ID is already defined.
*/ */
static void set_oem_spec_val(smc) static void set_oem_spec_val(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct fddi_mib *mib ; struct fddi_mib *mib ;
...@@ -66,9 +65,8 @@ struct s_smc *smc ; ...@@ -66,9 +65,8 @@ struct s_smc *smc ;
/* /*
* Init SMT * Init SMT
*/ */
int init_smt(smc,mac_addr) int init_smt(struct s_smc *smc, u_char *mac_addr)
struct s_smc *smc ; /* u_char *mac_addr; canonical address or NULL */
u_char *mac_addr ; /* canonical address or NULL */
{ {
int p ; int p ;
...@@ -124,3 +122,4 @@ u_char *mac_addr ; /* canonical address or NULL */ ...@@ -124,3 +122,4 @@ u_char *mac_addr ; /* canonical address or NULL */
return(0) ; return(0) ;
} }
...@@ -82,8 +82,9 @@ static struct s_ptab { ...@@ -82,8 +82,9 @@ static struct s_ptab {
/* /*
* local function declarations * local function declarations
*/ */
static u_long parse_num() ; static u_long parse_num(int type, char _far *value, char *v, u_long mn,
static int parse_word() ; u_long mx, int scale);
static int parse_word(char *buf, char _far *text);
#ifdef SIM #ifdef SIM
#define DB_MAIN(a,b,c) printf(a,b,c) #define DB_MAIN(a,b,c) printf(a,b,c)
...@@ -117,11 +118,8 @@ static int parse_word() ; ...@@ -117,11 +118,8 @@ static int parse_word() ;
* *
* END_MANUAL_ENTRY() * END_MANUAL_ENTRY()
*/ */
int smt_parse_arg(smc,keyword,type,value) int smt_parse_arg(struct s_smc *smc, char _far *keyword, int type,
struct s_smc *smc ; char _far *value)
char _far *keyword ;
int type ;
char _far *value ;
{ {
char keybuf[MAX_VAL+1]; char keybuf[MAX_VAL+1];
char valbuf[MAX_VAL+1]; char valbuf[MAX_VAL+1];
...@@ -287,9 +285,7 @@ char _far *value ; ...@@ -287,9 +285,7 @@ char _far *value ;
return(0) ; return(0) ;
} }
static int parse_word(buf,text) static int parse_word(char *buf, char _far *text)
char *buf ;
char _far *text ;
{ {
char c ; char c ;
char *p ; char *p ;
...@@ -364,13 +360,8 @@ char _far *text ; ...@@ -364,13 +360,8 @@ char _far *text ;
return(0) ; return(0) ;
} }
static u_long parse_num(type,value,v,mn,mx,scale) static u_long parse_num(int type, char _far *value, char *v, u_long mn,
int type ; u_long mx, int scale)
char _far *value ;
char *v ;
u_long mn ;
u_long mx ;
int scale ;
{ {
u_long x = 0 ; u_long x = 0 ;
char c ; char c ;
...@@ -473,3 +464,4 @@ main() ...@@ -473,3 +464,4 @@ main()
exit(0) ; exit(0) ;
} }
#endif #endif
...@@ -26,18 +26,9 @@ ...@@ -26,18 +26,9 @@
static const char ID_sccs[] = "@(#)smttimer.c 2.4 97/08/04 (C) SK " ; static const char ID_sccs[] = "@(#)smttimer.c 2.4 97/08/04 (C) SK " ;
#endif #endif
/* static void timer_done(struct s_smc *smc, int restart);
* external function declarations
*/
extern u_long hwt_read() ;
extern void hwt_stop() ;
extern void hwt_start() ;
static void timer_done() ;
void smt_timer_init(struct s_smc *smc)
void smt_timer_init(smc)
struct s_smc *smc ;
{ {
smc->t.st_queue = 0 ; smc->t.st_queue = 0 ;
smc->t.st_fast.tm_active = FALSE ; smc->t.st_fast.tm_active = FALSE ;
...@@ -45,9 +36,7 @@ struct s_smc *smc ; ...@@ -45,9 +36,7 @@ struct s_smc *smc ;
hwt_init(smc) ; hwt_init(smc) ;
} }
void smt_timer_stop(smc,timer) void smt_timer_stop(struct s_smc *smc, struct smt_timer *timer)
struct s_smc *smc ;
struct smt_timer *timer ;
{ {
struct smt_timer **prev ; struct smt_timer **prev ;
struct smt_timer *tm ; struct smt_timer *tm ;
...@@ -70,11 +59,8 @@ struct smt_timer *timer ; ...@@ -70,11 +59,8 @@ struct smt_timer *timer ;
} }
} }
void smt_timer_start(smc,timer,time,token) void smt_timer_start(struct s_smc *smc, struct smt_timer *timer, u_long time,
struct s_smc *smc ; u_long token)
struct smt_timer *timer ;
u_long time ;
u_long token ;
{ {
struct smt_timer **prev ; struct smt_timer **prev ;
struct smt_timer *tm ; struct smt_timer *tm ;
...@@ -121,21 +107,17 @@ u_long token ; ...@@ -121,21 +107,17 @@ u_long token ;
hwt_start(smc,smc->t.st_queue->tm_delta) ; hwt_start(smc,smc->t.st_queue->tm_delta) ;
} }
void smt_force_irq(smc) void smt_force_irq(struct s_smc *smc)
struct s_smc *smc ;
{ {
smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST)); smt_timer_start(smc,&smc->t.st_fast,32L, EV_TOKEN(EVENT_SMT,SM_FAST));
} }
void smt_timer_done(smc) void smt_timer_done(struct s_smc *smc)
struct s_smc *smc ;
{ {
timer_done(smc,1) ; timer_done(smc,1) ;
} }
static void timer_done(smc,restart) static void timer_done(struct s_smc *smc, int restart)
struct s_smc *smc ;
int restart ;
{ {
u_long delta ; u_long delta ;
struct smt_timer *tm ; struct smt_timer *tm ;
...@@ -171,3 +153,4 @@ int restart ; ...@@ -171,3 +153,4 @@ int restart ;
if (restart && smc->t.st_queue) if (restart && smc->t.st_queue)
hwt_start(smc,smc->t.st_queue->tm_delta) ; hwt_start(smc,smc->t.st_queue->tm_delta) ;
} }
...@@ -38,10 +38,10 @@ static const char ID_sccs[] = "@(#)srf.c 1.18 97/08/04 (C) SK " ; ...@@ -38,10 +38,10 @@ static const char ID_sccs[] = "@(#)srf.c 1.18 97/08/04 (C) SK " ;
/* /*
* function declarations * function declarations
*/ */
static void clear_all_rep() ; static void clear_all_rep(struct s_smc *smc);
static void clear_reported() ; static void clear_reported(struct s_smc *smc);
static void smt_send_srf() ; static void smt_send_srf(struct s_smc *smc);
static struct s_srf_evc *smt_get_evc() ; static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index);
#define MAX_EVCS (sizeof(smc->evcs)/sizeof(smc->evcs[0])) #define MAX_EVCS (sizeof(smc->evcs)/sizeof(smc->evcs[0]))
...@@ -69,8 +69,7 @@ static const struct evc_init evc_inits[] = { ...@@ -69,8 +69,7 @@ static const struct evc_init evc_inits[] = {
#define MAX_INIT_EVC (sizeof(evc_inits)/sizeof(evc_inits[0])) #define MAX_INIT_EVC (sizeof(evc_inits)/sizeof(evc_inits[0]))
void smt_init_evc(smc) void smt_init_evc(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct s_srf_evc *evc ; struct s_srf_evc *evc ;
const struct evc_init *init ; const struct evc_init *init ;
...@@ -159,10 +158,7 @@ struct s_smc *smc ; ...@@ -159,10 +158,7 @@ struct s_smc *smc ;
smc->srf.sr_state = SR0_WAIT ; smc->srf.sr_state = SR0_WAIT ;
} }
static struct s_srf_evc *smt_get_evc(smc,code,index) static struct s_srf_evc *smt_get_evc(struct s_smc *smc, int code, int index)
struct s_smc *smc ;
int code ;
int index ;
{ {
int i ; int i ;
struct s_srf_evc *evc ; struct s_srf_evc *evc ;
...@@ -188,11 +184,7 @@ static const char * const srf_names[] = { ...@@ -188,11 +184,7 @@ static const char * const srf_names[] = {
} ; } ;
#endif #endif
void smt_srf_event(smc,code,index,cond) void smt_srf_event(struct s_smc *smc, int code, int index, int cond)
struct s_smc *smc ;
int code ;
int index ;
int cond ;
{ {
struct s_srf_evc *evc ; struct s_srf_evc *evc ;
int cond_asserted = 0 ; int cond_asserted = 0 ;
...@@ -340,8 +332,7 @@ int cond ; ...@@ -340,8 +332,7 @@ int cond ;
} }
} }
static void clear_all_rep(smc) static void clear_all_rep(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct s_srf_evc *evc ; struct s_srf_evc *evc ;
int i ; int i ;
...@@ -354,8 +345,7 @@ struct s_smc *smc ; ...@@ -354,8 +345,7 @@ struct s_smc *smc ;
smc->srf.any_report = FALSE ; smc->srf.any_report = FALSE ;
} }
static void clear_reported(smc) static void clear_reported(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct s_srf_evc *evc ; struct s_srf_evc *evc ;
int i ; int i ;
...@@ -375,13 +365,10 @@ struct s_smc *smc ; ...@@ -375,13 +365,10 @@ struct s_smc *smc ;
} }
} }
extern SMbuf *smt_build_frame() ;
/* /*
* build and send SMT SRF frame * build and send SMT SRF frame
*/ */
static void smt_send_srf(smc) static void smt_send_srf(struct s_smc *smc)
struct s_smc *smc ;
{ {
struct smt_header *smt ; struct smt_header *smt ;
...@@ -439,3 +426,4 @@ struct s_smc *smc ; ...@@ -439,3 +426,4 @@ struct s_smc *smc ;
#endif /* no BOOT */ #endif /* no BOOT */
#endif /* no SLIM_SMT */ #endif /* no SLIM_SMT */
...@@ -96,16 +96,51 @@ static const char version[] = ...@@ -96,16 +96,51 @@ static const char version[] =
#define USE_32_BIT 1 #define USE_32_BIT 1
#endif #endif
#if defined(__H8300H__) || defined(__H8300S__)
#define NO_AUTOPROBE
#undef insl
#undef outsl
#define insl(a,b,l) io_insl_noswap(a,b,l)
#define outsl(a,b,l) io_outsl_noswap(a,b,l)
#endif
/* /*
.the SMC9194 can be at any of the following port addresses. To change, .the SMC9194 can be at any of the following port addresses. To change,
.for a slightly different card, you can add it to the array. Keep in .for a slightly different card, you can add it to the array. Keep in
.mind that the array must end in zero. .mind that the array must end in zero.
*/ */
static unsigned int smc_portlist[] __initdata = {
0x200, 0x220, 0x240, 0x260, 0x280, 0x2A0, 0x2C0, 0x2E0, struct devlist {
0x300, 0x320, 0x340, 0x360, 0x380, 0x3A0, 0x3C0, 0x3E0, 0 unsigned int port;
unsigned int irq;
}; };
#if defined(CONFIG_H8S_EDOSK2674)
static struct devlist smc_devlist[] __initdata = {
{.port = 0xf80000, .irq = 16},
{.port = 0, .irq = 0 },
};
#else
static struct devlist smc_devlist[] __initdata = {
{.port = 0x200, .irq = 0},
{.port = 0x220, .irq = 0},
{.port = 0x240, .irq = 0},
{.port = 0x260, .irq = 0},
{.port = 0x280, .irq = 0},
{.port = 0x2A0, .irq = 0},
{.port = 0x2C0, .irq = 0},
{.port = 0x2E0, .irq = 0},
{.port = 0x300, .irq = 0},
{.port = 0x320, .irq = 0},
{.port = 0x340, .irq = 0},
{.port = 0x360, .irq = 0},
{.port = 0x380, .irq = 0},
{.port = 0x3A0, .irq = 0},
{.port = 0x3C0, .irq = 0},
{.port = 0x3E0, .irq = 0},
{.port = 0, .irq = 0},
};
#endif
/* /*
. Wait time for memory to be free. This probably shouldn't be . Wait time for memory to be free. This probably shouldn't be
. tuned that much, as waiting for this means nothing else happens . tuned that much, as waiting for this means nothing else happens
...@@ -468,7 +503,7 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs ...@@ -468,7 +503,7 @@ static void smc_setmulticast( int ioaddr, int count, struct dev_mc_list * addrs
static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev ) static int smc_wait_to_send_packet( struct sk_buff * skb, struct net_device * dev )
{ {
struct smc_local *lp = netdev_priv(dev); struct smc_local *lp = netdev_priv(dev);
unsigned short ioaddr = dev->base_addr; unsigned int ioaddr = dev->base_addr;
word length; word length;
unsigned short numPages; unsigned short numPages;
word time_out; word time_out;
...@@ -582,7 +617,7 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -582,7 +617,7 @@ static void smc_hardware_send_packet( struct net_device * dev )
byte packet_no; byte packet_no;
struct sk_buff * skb = lp->saved_skb; struct sk_buff * skb = lp->saved_skb;
word length; word length;
unsigned short ioaddr; unsigned int ioaddr;
byte * buf; byte * buf;
ioaddr = dev->base_addr; ioaddr = dev->base_addr;
...@@ -637,7 +672,11 @@ static void smc_hardware_send_packet( struct net_device * dev ) ...@@ -637,7 +672,11 @@ static void smc_hardware_send_packet( struct net_device * dev )
#ifdef USE_32_BIT #ifdef USE_32_BIT
if ( length & 0x2 ) { if ( length & 0x2 ) {
outsl(ioaddr + DATA_1, buf, length >> 2 ); outsl(ioaddr + DATA_1, buf, length >> 2 );
#if !defined(__H8300H__) && !defined(__H8300S__)
outw( *((word *)(buf + (length & 0xFFFFFFFC))),ioaddr +DATA_1); outw( *((word *)(buf + (length & 0xFFFFFFFC))),ioaddr +DATA_1);
#else
ctrl_outw( *((word *)(buf + (length & 0xFFFFFFFC))),ioaddr +DATA_1);
#endif
} }
else else
outsl(ioaddr + DATA_1, buf, length >> 2 ); outsl(ioaddr + DATA_1, buf, length >> 2 );
...@@ -693,9 +732,12 @@ static int ifport; ...@@ -693,9 +732,12 @@ static int ifport;
struct net_device * __init smc_init(int unit) struct net_device * __init smc_init(int unit)
{ {
struct net_device *dev = alloc_etherdev(sizeof(struct smc_local)); struct net_device *dev = alloc_etherdev(sizeof(struct smc_local));
unsigned *port; static struct devlist *smcdev = smc_devlist;
int err = 0; int err = 0;
#ifndef NO_AUTOPROBE
smcdev = smc_devlist;
#endif
if (!dev) if (!dev)
return ERR_PTR(-ENODEV); return ERR_PTR(-ENODEV);
...@@ -713,11 +755,11 @@ struct net_device * __init smc_init(int unit) ...@@ -713,11 +755,11 @@ struct net_device * __init smc_init(int unit)
} else if (io != 0) { /* Don't probe at all. */ } else if (io != 0) { /* Don't probe at all. */
err = -ENXIO; err = -ENXIO;
} else { } else {
for (port = smc_portlist; *port; port++) { for (;smcdev->port; smcdev++) {
if (smc_probe(dev, *port) == 0) if (smc_probe(dev, smcdev->port) == 0)
break; break;
} }
if (!*port) if (!smcdev->port)
err = -ENODEV; err = -ENODEV;
} }
if (err) if (err)
...@@ -743,6 +785,7 @@ struct net_device * __init smc_init(int unit) ...@@ -743,6 +785,7 @@ struct net_device * __init smc_init(int unit)
*/ */
int __init smc_findirq( int ioaddr ) int __init smc_findirq( int ioaddr )
{ {
#ifndef NO_AUTOPROBE
int timeout = 20; int timeout = 20;
unsigned long cookie; unsigned long cookie;
...@@ -797,6 +840,14 @@ int __init smc_findirq( int ioaddr ) ...@@ -797,6 +840,14 @@ int __init smc_findirq( int ioaddr )
/* and return what I found */ /* and return what I found */
return probe_irq_off(cookie); return probe_irq_off(cookie);
#else /* NO_AUTOPROBE */
struct devlist *smcdev;
for (smcdev = smc_devlist; smcdev->port; smcdev++) {
if (smcdev->port == ioaddr)
return smcdev->irq;
}
return 0;
#endif
} }
/*---------------------------------------------------------------------- /*----------------------------------------------------------------------
...@@ -865,6 +916,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr) ...@@ -865,6 +916,7 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
retval = -ENODEV; retval = -ENODEV;
goto err_out; goto err_out;
} }
#if !defined(CONFIG_H8S_EDOSK2674)
/* well, we've already written once, so hopefully another time won't /* well, we've already written once, so hopefully another time won't
hurt. This time, I need to switch the bank register to bank 1, hurt. This time, I need to switch the bank register to bank 1,
so I can access the base address register */ so I can access the base address register */
...@@ -879,6 +931,10 @@ static int __init smc_probe(struct net_device *dev, int ioaddr) ...@@ -879,6 +931,10 @@ static int __init smc_probe(struct net_device *dev, int ioaddr)
retval = -ENODEV; retval = -ENODEV;
goto err_out; goto err_out;
} }
#else
(void)base_address_register; /* Warning suppression */
#endif
/* check if the revision register is something that I recognize. /* check if the revision register is something that I recognize.
These might need to be added to later, as future revisions These might need to be added to later, as future revisions
......
...@@ -2922,7 +2922,8 @@ static int is_quattro_p(struct pci_dev *pdev) ...@@ -2922,7 +2922,8 @@ static int is_quattro_p(struct pci_dev *pdev)
struct list_head *tmp; struct list_head *tmp;
int n_hmes; int n_hmes;
if (busdev->vendor != PCI_VENDOR_ID_DEC || if (busdev == NULL ||
busdev->vendor != PCI_VENDOR_ID_DEC ||
busdev->device != PCI_DEVICE_ID_DEC_21153) busdev->device != PCI_DEVICE_ID_DEC_21153)
return 0; return 0;
......
...@@ -1717,7 +1717,7 @@ tc35815_killall(void) ...@@ -1717,7 +1717,7 @@ tc35815_killall(void)
} }
static struct pci_driver tc35815_driver = { static struct pci_driver tc35815_driver = {
.name =TC35815_MODULE_NAME, .name = TC35815_MODULE_NAME,
.probe = tc35815_probe, .probe = tc35815_probe,
.remove = NULL, .remove = NULL,
.id_table = tc35815_pci_tbl, .id_table = tc35815_pci_tbl,
......
This diff is collapsed.
...@@ -1519,7 +1519,8 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw) ...@@ -1519,7 +1519,8 @@ static void __orinoco_ev_wterr(struct net_device *dev, hermes_t *hw)
static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw) static void __orinoco_ev_infdrop(struct net_device *dev, hermes_t *hw)
{ {
printk(KERN_WARNING "%s: Information frame lost.\n", dev->name); if (net_ratelimit())
printk(KERN_WARNING "%s: Information frame lost.\n", dev->name);
} }
static void print_linkstatus(struct net_device *dev, u16 status) static void print_linkstatus(struct net_device *dev, u16 status)
......
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