Commit dff74385 authored by Ralf Bächle's avatar Ralf Bächle

Merge bk://linux-ham@bkbits.net/main

into dea.linux-mips.net:/home/ralf/src/ax25/linux-2.5
parents d1009a88 8834e16c
......@@ -10,6 +10,7 @@
#include <linux/init.h>
#include <linux/ioport.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <asm/page.h>
#include <asm/oplib.h>
......@@ -17,6 +18,11 @@
#include <asm/smp.h>
#include <asm/spitfire.h>
/* Used to synchronize acceses to NatSemi SUPER I/O chip configure
* operations in asm/ns87303.h
*/
spinlock_t ns87303_lock = SPIN_LOCK_UNLOCKED;
struct prom_cpuinfo linux_cpus[NR_CPUS] __initdata = { { 0 } };
unsigned prom_cpu_nodes[NR_CPUS];
int linux_num_cpus = 0;
......
......@@ -45,7 +45,6 @@ cpuinfo_sparc cpu_data[NR_CPUS];
/* Please don't make this stuff initdata!!! --DaveM */
static unsigned char boot_cpu_id;
static int smp_activated;
/* Kernel spinlock */
spinlock_t kernel_flag __cacheline_aligned_in_smp = SPIN_LOCK_UNLOCKED;
......@@ -223,85 +222,46 @@ extern unsigned long sparc64_cpu_startup;
*/
static struct thread_info *cpu_new_thread = NULL;
static void __init smp_boot_cpus(unsigned int max_cpus)
static int __devinit smp_boot_one_cpu(unsigned int cpu)
{
int cpucount = 0, i;
unsigned long entry =
(unsigned long)(&sparc64_cpu_startup);
unsigned long cookie =
(unsigned long)(&cpu_new_thread);
struct task_struct *p;
int timeout, no, ret;
printk("Entering UltraSMPenguin Mode...\n");
local_irq_enable();
smp_store_cpu_info(boot_cpu_id);
if (linux_num_cpus == 1)
return;
for (i = 0; i < NR_CPUS; i++) {
if (i == boot_cpu_id)
continue;
if ((cpucount + 1) == max_cpus)
goto ignorecpu;
if (test_bit(i, &phys_cpu_present_map)) {
unsigned long entry =
(unsigned long)(&sparc64_cpu_startup);
unsigned long cookie =
(unsigned long)(&cpu_new_thread);
struct task_struct *p;
int timeout;
int no;
kernel_thread(NULL, NULL, CLONE_IDLETASK);
prom_printf("Starting CPU %d... ", i);
kernel_thread(NULL, NULL, CLONE_IDLETASK);
cpucount++;
p = prev_task(&init_task);
p = prev_task(&init_task);
init_idle(p, cpu);
init_idle(p, i);
unhash_process(p);
unhash_process(p);
callin_flag = 0;
for (no = 0; no < linux_num_cpus; no++)
if (linux_cpus[no].mid == i)
break;
cpu_new_thread = p->thread_info;
set_bit(i, &cpu_callout_map);
prom_startcpu(linux_cpus[no].prom_node,
entry, cookie);
for (timeout = 0; timeout < 5000000; timeout++) {
if (callin_flag)
break;
udelay(100);
}
if (callin_flag) {
prom_cpu_nodes[i] = linux_cpus[no].prom_node;
prom_printf("OK\n");
} else {
cpucount--;
printk("Processor %d is stuck.\n", i);
prom_printf("FAILED\n");
clear_bit(i, &cpu_callout_map);
}
ignorecpu:
}
callin_flag = 0;
for (no = 0; no < linux_num_cpus; no++)
if (linux_cpus[no].mid == cpu)
break;
cpu_new_thread = p->thread_info;
set_bit(cpu, &cpu_callout_map);
prom_startcpu(linux_cpus[no].prom_node, entry, cookie);
for (timeout = 0; timeout < 5000000; timeout++) {
if (callin_flag)
break;
udelay(100);
}
cpu_new_thread = NULL;
if (cpucount == 0) {
if (max_cpus != 1)
printk("Error: only one processor found.\n");
if (callin_flag) {
prom_cpu_nodes[cpu] = linux_cpus[no].prom_node;
ret = 0;
} else {
unsigned long bogosum = 0;
for (i = 0; i < NR_CPUS; i++) {
if (cpu_online(i))
bogosum += cpu_data[i].udelay_val;
}
printk("Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
cpucount + 1,
bogosum/(500000/HZ),
(bogosum/(5000/HZ))%100);
smp_activated = 1;
printk("Processor %d is stuck.\n", cpu);
clear_bit(cpu, &cpu_callout_map);
ret = -ENODEV;
}
cpu_new_thread = NULL;
return ret;
}
static void spitfire_xcall_helper(u64 data0, u64 data1, u64 data2, u64 pstate, unsigned long cpu)
......@@ -1119,8 +1079,6 @@ static void __init smp_setup_percpu_timer(void)
void __init smp_tick_init(void)
{
int i;
boot_cpu_id = hard_smp_processor_id();
current_tick_offset = timer_tick_offset;
......@@ -1129,19 +1087,10 @@ void __init smp_tick_init(void)
prom_halt();
}
atomic_set(&sparc64_num_cpus_online, 1);
memset(&cpu_online_map, 0, sizeof(cpu_online_map));
atomic_inc(&sparc64_num_cpus_online);
set_bit(boot_cpu_id, &cpu_online_map);
prom_cpu_nodes[boot_cpu_id] = linux_cpus[0].prom_node;
prof_counter(boot_cpu_id) = prof_multiplier(boot_cpu_id) = 1;
for (i = 0; i < linux_num_cpus; i++) {
if (linux_cpus[i].mid < NR_CPUS) {
set_bit(linux_cpus[i].mid,
&phys_cpu_present_map);
atomic_inc(&sparc64_num_cpus_possible);
}
}
}
cycles_t cacheflush_time;
......@@ -1272,19 +1221,59 @@ int setup_profiling_timer(unsigned int multiplier)
void __init smp_prepare_cpus(unsigned int max_cpus)
{
smp_boot_cpus(max_cpus);
int i;
for (i = 0; i < linux_num_cpus; i++) {
if (linux_cpus[i].mid < max_cpus) {
set_bit(linux_cpus[i].mid,
&phys_cpu_present_map);
atomic_inc(&sparc64_num_cpus_possible);
}
}
if (atomic_read(&sparc64_num_cpus_possible) > max_cpus) {
for (i = linux_num_cpus - 1; i >= 0; i--) {
if (linux_cpus[i].mid != boot_cpu_id) {
clear_bit(linux_cpus[i].mid,
&phys_cpu_present_map);
atomic_dec(&sparc64_num_cpus_possible);
if (atomic_read(&sparc64_num_cpus_possible) <= max_cpus)
break;
}
}
}
smp_store_cpu_info(boot_cpu_id);
}
int __devinit __cpu_up(unsigned int cpu)
{
set_bit(cpu, &smp_commenced_mask);
while (!test_bit(cpu, &cpu_online_map))
mb();
return 0;
int ret = smp_boot_one_cpu(cpu);
if (!ret) {
set_bit(cpu, &smp_commenced_mask);
while (!test_bit(cpu, &cpu_online_map))
mb();
if (!test_bit(cpu, &cpu_online_map))
ret = -ENODEV;
}
return ret;
}
void __init smp_cpus_done(unsigned int max_cpus)
{
unsigned long bogosum = 0;
int i;
for (i = 0; i < NR_CPUS; i++) {
if (cpu_online(i))
bogosum += cpu_data[i].udelay_val;
}
printk("Total of %d processors activated "
"(%lu.%02lu BogoMIPS).\n",
num_online_cpus(),
bogosum/(500000/HZ),
(bogosum/(5000/HZ))%100);
/* We want to run this with all the other cpus spinning
* in the kernel.
*/
......
......@@ -52,6 +52,7 @@
#include <asm/isa.h>
#endif
#include <asm/a.out.h>
#include <asm/ns87303.h>
struct poll {
int fd;
......@@ -373,3 +374,6 @@ EXPORT_SYMBOL(kbd_pt_regs);
#ifdef CONFIG_DEBUG_BUGVERBOSE
EXPORT_SYMBOL(do_BUG);
#endif
/* for ns8703 */
EXPORT_SYMBOL(ns87303_lock);
......@@ -250,8 +250,8 @@ solaris_sys_table:
.word solaris_fstatvfs64 /* fstatvfs64 dP 219 */
.word solaris_setrlimit64 /* setrlimit64 dP 220 */
.word solaris_getrlimit64 /* getrlimit64 dP 221 */
.word CHAIN(pread) /* pread64 dpdD 222 */
.word CHAIN(pwrite) /* pwrite64 dpdD 223 */
.word CHAIN(pread64) /* pread64 dpdD 222 */
.word CHAIN(pwrite64) /* pwrite64 dpdD 223 */
.word CHAIN(creat) /* creat64 so 224 */
.word solaris_open /* open64 soo 225 */
.word solaris_unimplemented /* 226 */
......
......@@ -221,6 +221,8 @@ typedef enum {
FE2000VX,
ALLIED8139,
RTL8129,
FNW3603TX,
FNW3800TX,
} board_t;
......@@ -240,6 +242,8 @@ static struct {
{ "AboCom FE2000VX (RealTek RTL8139)", RTL8139_CAPS },
{ "Allied Telesyn 8139 CardBus", RTL8139_CAPS },
{ "RealTek RTL8129", RTL8129_CAPS },
{ "Planex FNW-3603-TX 10/100 CardBus", RTL8139_CAPS },
{ "Planex FNW-3800-TX 10/100 CardBus", RTL8139_CAPS },
};
......@@ -254,6 +258,8 @@ static struct pci_device_id rtl8139_pci_tbl[] __devinitdata = {
{0x1186, 0x1340, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DFE690TXD },
{0x13d1, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FE2000VX },
{0x1259, 0xa117, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ALLIED8139 },
{0x14ea, 0xab06, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FNW3603TX },
{0x14ea, 0xab07, PCI_ANY_ID, PCI_ANY_ID, 0, 0, FNW3800TX },
#ifdef CONFIG_8139TOO_8129
{0x10ec, 0x8129, PCI_ANY_ID, PCI_ANY_ID, 0, 0, RTL8129 },
......
......@@ -1108,7 +1108,6 @@ set_multicast (struct net_device *dev)
u16 rx_mode = 0;
int i;
int bit;
int index, crc;
struct dev_mc_list *mclist;
struct netdev_private *np = dev->priv;
......@@ -1130,13 +1129,14 @@ set_multicast (struct net_device *dev)
for (i=0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist=mclist->next) {
crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
int index = 0;
int crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
/* The inverted high significant 6 bits of CRC are
used as an index to hashtable */
for (index = 0, bit = 0; bit < 6; bit++)
if (test_bit(31 - bit, &crc))
set_bit(bit, &index);
for (bit = 0; bit < 6; bit++)
if (crc & (1 << (31 - bit)))
index |= (1 << bit);
hash_table[index / 32] |= (1 << (index % 32));
}
......@@ -1635,7 +1635,7 @@ rio_close (struct net_device *dev)
/* Stop Tx and Rx logics */
writel (TxDisable | RxDisable | StatsDisable, ioaddr + MACCtrl);
synchronize_irq ();
synchronize_irq (dev->irq);
free_irq (dev->irq, dev);
del_timer_sync (&np->timer);
......
......@@ -804,8 +804,6 @@ static struct pci_driver e100_driver = {
#ifdef CONFIG_PM
.suspend = e100_suspend,
.resume = e100_resume,
.save_state = e100_save_state,
.enable_wake = e100_enable_wake,
#endif
};
......
......@@ -23,6 +23,8 @@
This is a compatibility hardware problem.
Versions:
0.13a in memory shortage, drop packets also in board
(Michael Westermann <mw@microdata-pos.de>, 07/30/2002)
0.13 irq sharing, rewrote probe function, fixed a nasty bug in
hardware_send_packet and a major cleanup (aris, 11/08/2001)
0.12d fixing a problem with single card detected as eight eth devices
......@@ -665,37 +667,37 @@ static void eepro_print_info (struct net_device *dev)
i = inb(dev->base_addr + ID_REG);
printk(KERN_DEBUG " id: %#x ",i);
printk(KERN_DEBUG " io: %#x ", (unsigned)dev->base_addr);
printk(" io: %#x ", (unsigned)dev->base_addr);
switch (lp->eepro) {
case LAN595FX_10ISA:
printk(KERN_INFO "%s: Intel EtherExpress 10 ISA\n at %#x,",
printk("%s: Intel EtherExpress 10 ISA\n at %#x,",
dev->name, (unsigned)dev->base_addr);
break;
case LAN595FX:
printk(KERN_INFO "%s: Intel EtherExpress Pro/10+ ISA\n at %#x,",
printk("%s: Intel EtherExpress Pro/10+ ISA\n at %#x,",
dev->name, (unsigned)dev->base_addr);
break;
case LAN595TX:
printk(KERN_INFO "%s: Intel EtherExpress Pro/10 ISA at %#x,",
printk("%s: Intel EtherExpress Pro/10 ISA at %#x,",
dev->name, (unsigned)dev->base_addr);
break;
case LAN595:
printk(KERN_INFO "%s: Intel 82595-based lan card at %#x,",
printk("%s: Intel 82595-based lan card at %#x,",
dev->name, (unsigned)dev->base_addr);
}
for (i=0; i < 6; i++)
printk(KERN_INFO "%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
printk("%c%02x", i ? ':' : ' ', dev->dev_addr[i]);
if (net_debug > 3)
printk(KERN_DEBUG ", %dK RCV buffer",
(int)(lp->rcv_ram)/1024);
if (dev->irq > 2)
printk(KERN_INFO ", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]);
printk(", IRQ %d, %s.\n", dev->irq, ifmap[dev->if_port]);
else
printk(KERN_INFO ", %s.\n", ifmap[dev->if_port]);
printk(", %s.\n", ifmap[dev->if_port]);
if (net_debug > 3) {
i = read_eeprom(dev->base_addr, 5, dev);
......@@ -1584,6 +1586,10 @@ eepro_rx(struct net_device *dev)
if (skb == NULL) {
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n", dev->name);
lp->stats.rx_dropped++;
rcv_car = lp->rx_start + RCV_HEADER + rcv_size;
lp->rx_start = rcv_next_frame;
outw(rcv_next_frame, ioaddr + HOST_ADDRESS_REG);
break;
}
skb->dev = dev;
......
/* drivers/net/eepro100.c: An Intel i82557-559 Ethernet driver for Linux. */
/*
NOTICE: For use with late 2.3 kernels only.
May not compile for kernels 2.3.43-47.
Written 1996-1999 by Donald Becker.
The driver also contains updates by different kernel developers
......@@ -25,8 +23,8 @@
Disabled FC and ER, to avoid lockups when when we get FCP interrupts.
2000 Jul 17 Goutham Rao <goutham.rao@intel.com>
PCI DMA API fixes, adding pci_dma_sync_single calls where neccesary
2000 Aug 31 David Mosberger <davidm@hpl.hp.com>
RX_ALIGN support: enables rx DMA without causing unaligned accesses.
2000 Aug 31 David Mosberger <davidm@hpl.hp.com>
rx_align support: enables rx DMA without causing unaligned accesses.
*/
static const char *version =
......@@ -46,9 +44,10 @@ static int rxdmacount /* = 0 */;
#if defined(__ia64__) || defined(__alpha__) || defined(__sparc__) || defined(__mips__) || \
defined(__arm__)
/* align rx buffers to 2 bytes so that IP header is aligned */
# define RX_ALIGN
# define rx_align(skb) skb_reserve((skb), 2)
# define RxFD_ALIGNMENT __attribute__ ((aligned (2), packed))
#else
# define rx_align(skb)
# define RxFD_ALIGNMENT
#endif
......@@ -531,10 +530,6 @@ static int eepro100_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent);
static void eepro100_remove_one (struct pci_dev *pdev);
#ifdef CONFIG_PM
static int eepro100_suspend (struct pci_dev *pdev, u32 state);
static int eepro100_resume (struct pci_dev *pdev);
#endif
static int do_eeprom_cmd(long ioaddr, int cmd, int cmd_len);
static int mdio_read(long ioaddr, int phy_id, int location);
......@@ -1240,9 +1235,8 @@ speedo_init_rx_ring(struct net_device *dev)
for (i = 0; i < RX_RING_SIZE; i++) {
struct sk_buff *skb;
skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD));
#ifdef RX_ALIGN
skb_reserve(skb, 2); /* Align IP on 16 byte boundary */
#endif
/* XXX: do we really want to call this before the NULL check? --hch */
rx_align(skb); /* Align IP on 16 byte boundary */
sp->rx_skbuff[i] = skb;
if (skb == NULL)
break; /* OK. Just initially short of Rx bufs. */
......@@ -1634,9 +1628,8 @@ static inline struct RxFD *speedo_rx_alloc(struct net_device *dev, int entry)
struct sk_buff *skb;
/* Get a fresh skbuff to replace the consumed one. */
skb = dev_alloc_skb(PKT_BUF_SZ + sizeof(struct RxFD));
#ifdef RX_ALIGN
skb_reserve(skb, 2); /* Align IP on 16 byte boundary */
#endif
/* XXX: do we really want to call this before the NULL check? --hch */
rx_align(skb); /* Align IP on 16 byte boundary */
sp->rx_skbuff[entry] = skb;
if (skb == NULL) {
sp->rx_ringp[entry] = NULL;
......@@ -2320,12 +2313,10 @@ static struct pci_driver eepro100_driver = {
.name = "eepro100",
.id_table = eepro100_pci_tbl,
.probe = eepro100_init_one,
# if defined(MODULE) || defined(CONFIG_HOTPLUG)
.remove = __devexit_p(eepro100_remove_one),
# endif
#ifdef CONFIG_PM
.suspend = eepro100_suspend,
.resume = eepro100_resume,
.resume = eepro100_resume,
#endif /* CONFIG_PM */
};
......
......@@ -63,12 +63,15 @@
LK1.1.13:
* revert version 1.1.12, power-up sequence "fix"
*/
LK1.1.14 (Kryzsztof Halasa):
* fix spurious bad initializations
* pound phy a la SMSC's app note on the subject
#define DRV_NAME "epic100"
#define DRV_VERSION "1.11+LK1.1.13"
#define DRV_RELDATE "Mar 20, 2002"
*/
#define DRV_NAME "epic100"
#define DRV_VERSION "1.11+LK1.1.14"
#define DRV_RELDATE "Aug 4, 2002"
/* The user-configurable values.
These may be modified when a driver module is loaded.*/
......@@ -457,7 +460,9 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
/* Bring the chip out of low-power mode. */
outl(0x4200, ioaddr + GENCTL);
/* Magic?! If we don't set this bit the MII interface won't work. */
outl(0x0008, ioaddr + TEST1);
/* This magic is documented in SMSC app note 7.15 */
for (i = 16; i > 0; i--)
outl(0x0008, ioaddr + TEST1);
/* Turn on the MII transceiver. */
outl(0x12, ioaddr + MIICfg);
......@@ -674,7 +679,8 @@ static int epic_open(struct net_device *dev)
outl(0x4000, ioaddr + GENCTL);
/* This magic is documented in SMSC app note 7.15 */
outl(0x0008, ioaddr + TEST1);
for (i = 16; i > 0; i--)
outl(0x0008, ioaddr + TEST1);
/* Pull the chip out of low-power mode, enable interrupts, and set for
PCI read multiple. The MIIcfg setting and strange write order are
......@@ -697,6 +703,8 @@ static int epic_open(struct net_device *dev)
outl(0x0412 | (RX_FIFO_THRESH<<8), ioaddr + GENCTL);
#endif
udelay(20); /* Looks like EPII needs that if you want reliable RX init. FIXME: pci posting bug? */
for (i = 0; i < 3; i++)
outl(cpu_to_le16(((u16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4);
......
......@@ -546,8 +546,11 @@ static void myri_interrupt(int irq, void *dev_id, struct pt_regs *regs)
struct myri_eth *mp = (struct myri_eth *) dev->priv;
unsigned long lregs = mp->lregs;
struct myri_channel *chan = &mp->shmem->channel;
unsigned long flags;
u32 status;
spin_lock_irqsave(&mp->irq_lock, flags);
status = sbus_readl(lregs + LANAI_ISTAT);
DIRQ(("myri_interrupt: status[%08x] ", status));
if (status & ISTAT_HOST) {
......@@ -569,6 +572,8 @@ static void myri_interrupt(int irq, void *dev_id, struct pt_regs *regs)
myri_enable_irq(lregs, mp->cregs);
}
DIRQ(("\n"));
spin_unlock_irqrestore(&mp->irq_lock, flags);
}
static int myri_open(struct net_device *dev)
......@@ -622,7 +627,7 @@ static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 1;
}
save_and_cli(flags);
spin_lock_irqsave(&mp->irq_lock, flags);
DHDR(("xmit[skbdata(%p)]\n", skb->data));
#ifdef DEBUG_HEADER
......@@ -669,7 +674,7 @@ static int myri_start_xmit(struct sk_buff *skb, struct net_device *dev)
DTX(("tbusy=0, returning 0\n"));
netif_start_queue(dev);
restore_flags(flags);
spin_unlock_irqrestore(&mp->irq_lock, flags);
return 0;
}
......@@ -900,6 +905,7 @@ static int __init myri_ether_init(struct net_device *dev, struct sbus_dev *sdev,
printk("%s: MyriCOM MyriNET Ethernet ", dev->name);
mp = (struct myri_eth *) dev->priv;
spin_lock_init(&mp->irq_lock);
mp->myri_sdev = sdev;
/* Clean out skb arrays. */
......
......@@ -269,6 +269,7 @@ struct myri_eth {
/* These are frequently accessed, keep together
* to obtain good cache hit rates.
*/
spinlock_t irq_lock;
struct myri_shmem *shmem; /* Shared data structures. */
unsigned long cregs; /* Control register space. */
struct recvq *rqack; /* Where we ack rx's. */
......
......@@ -755,7 +755,7 @@ static void ns83820_cleanup_rx(struct ns83820 *dev)
/* synchronize with the interrupt handler and kill it */
dev->rx_info.up = 0;
synchronize_irq();
synchronize_irq(dev->pci_dev->irq);
/* touch the pci bus... */
readl(dev->base + IMR);
......@@ -1296,11 +1296,11 @@ static int ns83820_stop(struct net_device *_dev)
readl(dev->base + IER);
dev->rx_info.up = 0;
synchronize_irq();
synchronize_irq(dev->pci_dev->irq);
ns83820_do_reset(dev, CR_RST);
synchronize_irq();
synchronize_irq(dev->pci_dev->irq);
dev->IMR_cache &= ~(ISR_TXURN | ISR_TXIDLE | ISR_TXERR | ISR_TXDESC | ISR_TXOK);
ns83820_cleanup_rx(dev);
......
......@@ -461,7 +461,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev,
}
static void __exit dmfe_remove_one (struct pci_dev *pdev)
static void __devexit dmfe_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct dmfe_board_info *db = dev->priv;
......
......@@ -218,6 +218,9 @@ static struct pci_device_id tulip_pci_tbl[] __devinitdata = {
{ 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },
{ 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ 0x14f1, 0x1803, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CONEXANT },
{ 0x1186, 0x1561, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ 0x1626, 0x8410, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ 0x1737, 0xAB09, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },
{ } /* terminate list */
};
MODULE_DEVICE_TABLE(pci, tulip_pci_tbl);
......
......@@ -364,9 +364,7 @@ static struct pci_driver orinoco_pci_driver = {
.name = "orinoco_pci",
.id_table = orinoco_pci_pci_id_table,
.probe = orinoco_pci_init_one,
.remove = orinoco_pci_remove_one,
.suspend = 0,
.resume = 0
.remove = __devexit_p(orinoco_pci_remove_one),
};
static int __init orinoco_pci_init(void)
......
......@@ -363,6 +363,7 @@ static void __devexit orinoco_plx_remove_one(struct pci_dev *pdev)
static struct pci_device_id orinoco_plx_pci_id_table[] __devinitdata = {
{0x10b7, 0x7770, PCI_ANY_ID, PCI_ANY_ID,}, /* 3ComAirConnect */
{0x111a, 0x1023, PCI_ANY_ID, PCI_ANY_ID,}, /* Siemens SpeedStream SS1023 */
{0x1385, 0x4100, PCI_ANY_ID, PCI_ANY_ID,}, /* Netgear MA301 */
{0x15e8, 0x0130, PCI_ANY_ID, PCI_ANY_ID,}, /* Correga - does this work? */
......@@ -385,9 +386,7 @@ static struct pci_driver orinoco_plx_driver = {
.name = "orinoco_plx",
.id_table = orinoco_plx_pci_id_table,
.probe = orinoco_plx_init_one,
.remove = orinoco_plx_remove_one,
.suspend = 0,
.resume = 0
.remove = __devexit_p(orinoco_plx_remove_one),
};
static int __init orinoco_plx_init(void)
......
......@@ -147,7 +147,6 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
DATA *data = (DATA *) file->private_data;
char buffer[OPROMMAXPARAM+1], *buf;
struct openpromio *opp;
unsigned long flags;
int bufsize, len, error = 0;
extern char saved_command_line[];
static int cnt;
......@@ -163,18 +162,14 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
switch (cmd) {
case OPROMGETOPT:
case OPROMGETPROP:
save_and_cli(flags);
len = prom_getproplen(node, opp->oprom_array);
restore_flags(flags);
if (len <= 0 || len > bufsize) {
error = copyout((void *)arg, opp, sizeof(int));
break;
}
save_and_cli(flags);
len = prom_getproperty(node, opp->oprom_array, buffer, bufsize);
restore_flags(flags);
memcpy(opp->oprom_array, buffer, len);
opp->oprom_array[len] = '\0';
......@@ -185,9 +180,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
case OPROMNXTOPT:
case OPROMNXTPROP:
save_and_cli(flags);
buf = prom_nextprop(node, opp->oprom_array, buffer);
restore_flags(flags);
len = strlen(buf);
if (len == 0 || len + 1 > bufsize) {
......@@ -207,10 +200,8 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
buf = opp->oprom_array + strlen(opp->oprom_array) + 1;
len = opp->oprom_array + bufsize - buf;
save_and_cli(flags);
error = prom_setprop(options_node, opp->oprom_array,
buf, len);
restore_flags(flags);
if (error < 0)
error = -EINVAL;
......@@ -226,13 +217,11 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
node = *((int *) opp->oprom_array);
save_and_cli(flags);
switch (cmd) {
case OPROMNEXT: node = __prom_getsibling(node); break;
case OPROMCHILD: node = __prom_getchild(node); break;
case OPROMSETCUR: break;
}
restore_flags(flags);
data->current_node = node;
*((int *)opp->oprom_array) = node;
......@@ -264,9 +253,7 @@ static int openprom_sunos_ioctl(struct inode * inode, struct file * file,
break;
case OPROMPATH2NODE:
save_and_cli(flags);
node = prom_finddevice(opp->oprom_array);
restore_flags(flags);
data->current_node = node;
*((int *)opp->oprom_array) = node;
opp->oprom_size = sizeof(int);
......@@ -361,7 +348,6 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
{
DATA *data = (DATA *) file->private_data;
struct opiocdesc op;
unsigned long flags;
int error, node, len;
char *str, *tmp;
char buffer[64];
......@@ -379,9 +365,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if (error)
return error;
save_and_cli(flags);
len = prom_getproplen(op.op_nodeid,str);
restore_flags(flags);
if (len > op.op_buflen) {
kfree(str);
......@@ -405,9 +389,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
return -ENOMEM;
}
save_and_cli(flags);
prom_getproperty(op.op_nodeid, str, tmp, len);
restore_flags(flags);
tmp[len] = '\0';
......@@ -431,9 +413,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if (error)
return error;
save_and_cli(flags);
tmp = prom_nextprop(op.op_nodeid,str,buffer);
restore_flags(flags);
if (tmp) {
len = strlen(tmp);
......@@ -481,9 +461,7 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
return error;
}
save_and_cli(flags);
len = prom_setprop(op.op_nodeid,str,tmp,op.op_buflen+1);
restore_flags(flags);
if (len != op.op_buflen)
return -EINVAL;
......@@ -503,12 +481,10 @@ static int openprom_bsd_ioctl(struct inode * inode, struct file * file,
if (copy_from_user(&node, (void *)arg, sizeof(int)))
return -EFAULT;
save_and_cli(flags);
if (cmd == OPIOCGETNEXT)
node = __prom_getsibling(node);
else
node = __prom_getchild(node);
restore_flags(flags);
if (__copy_to_user((void *)arg, &node, sizeof(int)))
return -EFAULT;
......@@ -624,7 +600,6 @@ static struct miscdevice openprom_dev = {
static int __init openprom_init(void)
{
unsigned long flags;
int error;
error = misc_register(&openprom_dev);
......@@ -633,10 +608,8 @@ static int __init openprom_init(void)
return error;
}
save_and_cli(flags);
options_node = prom_getchild(prom_root_node);
options_node = prom_searchsiblings(options_node,"options");
restore_flags(flags);
if (options_node == 0 || options_node == -1) {
printk(KERN_ERR "openprom: unable to find options node\n");
......
......@@ -318,7 +318,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
risc_code_addr = 0x1000; /* all load addresses are at 0x1000 */
save_flags(flags); cli();
spin_lock_irqsave(&qpti->lock, flags);
sbus_writew(HCCTRL_PAUSE, qpti->qregs + HCCTRL);
......@@ -366,7 +366,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
if (qlogicpti_mbox_command(qpti, param, 1)) {
printk(KERN_EMERG "qlogicpti%d: Cannot execute ISP firmware.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -377,7 +377,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
(param[0] != MBOX_COMMAND_COMPLETE)) {
printk(KERN_EMERG "qlogicpti%d: Cannot set initiator SCSI ID.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -392,7 +392,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
if (qlogicpti_mbox_command(qpti, param, 1)) {
printk(KERN_EMERG "qlogicpti%d: Cannot init response queue.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -404,7 +404,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
if (qlogicpti_mbox_command(qpti, param, 1)) {
printk(KERN_EMERG "qlogicpti%d: Cannot init request queue.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -450,7 +450,7 @@ static int qlogicpti_reset_hardware(struct Scsi_Host *host)
qlogicpti_mbox_command(qpti, param, 0);
qpti->send_marker = 1;
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 0;
}
......@@ -468,7 +468,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
risc_code_addr = 0x1000; /* all f/w modules load at 0x1000 */
risc_code_length = sbus_risc_code_length01;
save_flags(flags); cli();
spin_lock_irqsave(&qpti->lock, flags);
/* Verify the checksum twice, one before loading it, and once
* afterwards via the mailbox commands.
......@@ -476,7 +476,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
for (i = 0; i < risc_code_length; i++)
csum += risc_code[i];
if (csum) {
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
printk(KERN_EMERG "qlogicpti%d: Aieee, firmware checksum failed!",
qpti->qpti_id);
return 1;
......@@ -488,7 +488,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
while (--timeout && (sbus_readw(qpti->qregs + SBUS_CTRL) & SBUS_CTRL_RESET))
udelay(20);
if (!timeout) {
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
printk(KERN_EMERG "qlogicpti%d: Cannot reset the ISP.", qpti->qpti_id);
return 1;
}
......@@ -528,7 +528,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
if (qlogicpti_mbox_command(qpti, param, 1)) {
printk(KERN_EMERG "qlogicpti%d: Cannot stop firmware for reload.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -541,7 +541,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
param[0] != MBOX_COMMAND_COMPLETE) {
printk("qlogicpti%d: Firmware dload failed, I'm bolixed!\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
}
......@@ -561,7 +561,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
(param[0] != MBOX_COMMAND_COMPLETE)) {
printk(KERN_EMERG "qlogicpti%d: New firmware csum failure!\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -575,7 +575,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
(param[0] != MBOX_COMMAND_COMPLETE)) {
printk(KERN_EMERG "qlogicpti%d: AboutFirmware cmd fails.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -591,7 +591,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
(param[0] != MBOX_COMMAND_COMPLETE)) {
printk(KERN_EMERG "qlogicpti%d: could not set clock rate.\n",
qpti->qpti_id);
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 1;
}
......@@ -608,7 +608,7 @@ static int __init qlogicpti_load_firmware(struct qlogicpti *qpti)
qlogicpti_mbox_command(qpti, param, 1);
}
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return 0;
}
......@@ -1166,8 +1166,8 @@ static void ourdone(Scsi_Cmnd *Cmnd)
int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
{
unsigned long flags;
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->host->hostdata;
unsigned long flags;
/*
* done checking this host adapter?
......@@ -1178,12 +1178,13 @@ int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
if (qpti->sbits && qpti->sbits != 0xffff) {
/* See above about in ourdone this ugliness... */
Cmnd->SCp.Message = ((unsigned long)done) & 0xffffffff;
#ifdef __sparc_v9__
#ifdef CONFIG_SPARC64
Cmnd->SCp.Status = ((unsigned long)done >> 32UL) & 0xffffffff;
#endif
return qlogicpti_queuecommand(Cmnd, ourdone);
}
save_flags(flags); cli();
spin_lock_irqsave(&qpti->lock, flags);
/*
* We've peeked at all targets for this bus- time
......@@ -1226,7 +1227,8 @@ int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
if (qpti == NULL)
Cmnd->host->hostt->queuecommand = qlogicpti_queuecommand;
restore_flags(flags);
spin_unlock_irqrestore(&qpti->lock, flags);
return qlogicpti_queuecommand(Cmnd, done);
}
......
This diff is collapsed.
/* $Id: sab82532.h,v 1.7 2001/05/23 23:09:10 ecd Exp $
* sab82532.h: Register Definitions for the Siemens SAB82532 DUSCC
/* sunsab.h: Register Definitions for the Siemens SAB82532 DUSCC
*
* Copyright (C) 1997 Eddie C. Dost (ecd@skynet.be)
*/
#ifndef _SPARC64_SAB82532_H
#define _SPARC64_SAB82532_H
#include <linux/types.h>
#include <linux/serial.h>
#include <linux/circ_buf.h>
#ifndef _SUNSAB_H
#define _SUNSAB_H
struct sab82532_async_rd_regs {
u8 rfifo[0x20]; /* Receive FIFO */
......@@ -120,8 +115,6 @@ union sab82532_async_regs {
__volatile__ struct sab82532_async_rw_regs rw;
};
#define NR_PORTS 2
union sab82532_irq_status {
unsigned short stat;
struct {
......@@ -130,62 +123,10 @@ union sab82532_irq_status {
} sreg;
};
struct sab82532 {
int magic;
int baud_base;
union sab82532_async_regs *regs;
int irq;
int flags; /* defined in tty.h */
int type; /* SAB82532 version */
struct tty_struct *tty;
int read_status_mask;
int ignore_status_mask;
int timeout;
int xmit_fifo_size;
int recv_fifo_size;
int custom_divisor;
int baud;
unsigned int cec_timeout;
unsigned int tec_timeout;
int x_char;
int close_delay;
unsigned short closing_wait;
unsigned short closing_wait2;
unsigned long irqflags;
int is_console;
unsigned char interrupt_mask0;
unsigned char interrupt_mask1;
unsigned char pvr_dtr_bit;
unsigned char pvr_dsr_bit;
unsigned char dcd;
unsigned char cts;
unsigned char dsr;
unsigned long event;
unsigned long last_active;
int line;
int count;
int blocked_open;
long session;
long pgrp;
struct circ_buf xmit;
struct tq_struct tqueue;
struct tq_struct tqueue_hangup;
struct async_icount icount;
struct termios normal_termios;
struct termios callout_termios;
wait_queue_head_t open_wait;
wait_queue_head_t close_wait;
wait_queue_head_t delta_msr_wait;
struct sab82532 *next;
struct sab82532 *prev;
};
/* irqflags bits */
#define SAB82532_ALLS 0x00000001
#define SAB82532_XPR 0x00000002
/* RFIFO Status Byte */
#define SAB82532_RSTAT_PE 0x80
#define SAB82532_RSTAT_FE 0x40
......@@ -377,4 +318,4 @@ struct sab82532 {
#define SAB82532_CCR4_ICD 0x10
#endif /* !(_SPARC64_SAB82532_H) */
#endif /* !(_SUNSAB_H) */
......@@ -1362,7 +1362,7 @@ static void sunsu_console_write(struct console *co, const char *s,
static kdev_t sunsu_console_device(struct console *co)
{
return mk_kdev(TTY_MAJOR, 64 + co->index);
return mk_kdev(sunsu_reg.major, sunsu_reg.minor + co->index);
}
/*
......@@ -1379,6 +1379,9 @@ static int __init sunsu_console_setup(struct console *co, char *options)
int parity = 'n';
int flow = 'n';
printk("Console: ttyS%d (SU)\n",
(sunsu_reg.minor - 64) + co->index);
/*
* Check whether an invalid uart number has been specified, and
* if so, search for the first available port that does have
......@@ -1414,15 +1417,23 @@ static struct console sunsu_cons = {
static int __init sunsu_serial_console_init(void)
{
int index;
int i;
if (con_is_present())
return 0;
index = serial_console - 1;
if (sunsu_ports[index].port_node == 0)
for (i = 0; i < UART_NR; i++) {
int this_minor = sunsu_reg.minor + i;
if ((this_minor - 64) == (serial_console - 1))
break;
}
if (i == UART_NR)
return 0;
sunsu_cons.index = index;
if (sunsu_ports[i].port_node == 0)
return 0;
sunsu_cons.index = i;
register_console(&sunsu_cons);
return 0;
}
......
......@@ -1013,7 +1013,6 @@ static struct uart_driver sunzilog_reg = {
.dev_name = "ttyS",
#endif
.major = TTY_MAJOR,
.minor = 64,
};
static void * __init alloc_one_table(unsigned long size)
......@@ -1386,7 +1385,7 @@ sunzilog_console_write(struct console *con, const char *s, unsigned int count)
static kdev_t sunzilog_console_device(struct console *con)
{
return mk_kdev(TTY_MAJOR, 64 + con->index);
return mk_kdev(sunzilog_reg.major, sunzilog_reg.minor + con->index);
}
static int __init sunzilog_console_setup(struct console *con, char *options)
......@@ -1395,7 +1394,8 @@ static int __init sunzilog_console_setup(struct console *con, char *options)
unsigned long flags;
int baud, brg;
printk("Console: ttyS%d (Zilog8530)\n", con->index / 2);
printk("Console: ttyS%d (Zilog8530)\n",
(sunzilog_reg.minor - 64) + con->index);
/* Get firmware console settings. */
sunserial_console_termios(con);
......@@ -1447,10 +1447,21 @@ static struct console sunzilog_console = {
static int __init sunzilog_console_init(void)
{
int i;
if (con_is_present())
return 0;
sunzilog_console.index = serial_console - 1;
for (i = 0; i < NUM_CHANNELS; i++) {
int this_minor = sunzilog_reg.minor + i;
if ((this_minor - 64) == (serial_console - 1))
break;
}
if (i == NUM_CHANNELS)
return 0;
sunzilog_console.index = i;
register_console(&sunzilog_console);
return 0;
}
......@@ -1480,6 +1491,7 @@ static void __init sunzilog_prepare(void)
up[(chip * 2) + 0].port.uartclk = ZS_CLOCK;
up[(chip * 2) + 0].port.fifosize = 1;
up[(chip * 2) + 0].port.ops = &sunzilog_pops;
up[(chip * 2) + 0].port.type = PORT_SUNZILOG;
up[(chip * 2) + 0].port.flags = 0;
up[(chip * 2) + 0].port.line = (chip * 2) + 0;
up[(chip * 2) + 0].flags |= SUNZILOG_FLAG_IS_CHANNEL_A;
......@@ -1490,6 +1502,7 @@ static void __init sunzilog_prepare(void)
up[(chip * 2) + 1].port.uartclk = ZS_CLOCK;
up[(chip * 2) + 1].port.fifosize = 1;
up[(chip * 2) + 1].port.ops = &sunzilog_pops;
up[(chip * 2) + 1].port.type = PORT_SUNZILOG;
up[(chip * 2) + 1].port.flags = 0;
up[(chip * 2) + 1].port.line = (chip * 2) + 1;
up[(chip * 2) + 1].flags |= 0;
......@@ -1607,12 +1620,10 @@ static int __init sunzilog_ports_init(void)
* in the system.
*/
sunzilog_reg.nr = NUM_CHANNELS;
#ifdef CONFIG_SERIAL_CONSOLE
sunzilog_reg.cons = &sunzilog_console;
#else
sunzilog_reg.cons = NULL;
#endif
sunzilog_reg.minor = sunserial_current_minor;
sunserial_current_minor += NUM_CHANNELS;
ret = uart_register_driver(&sunzilog_reg);
if (ret == 0) {
......
......@@ -78,9 +78,13 @@
#ifdef __KERNEL__
#include <linux/spinlock.h>
#include <asm/system.h>
#include <asm/io.h>
extern spinlock_t ns87303_lock;
static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
unsigned char clr, unsigned char set)
{
......@@ -96,14 +100,16 @@ static __inline__ int ns87303_modify(unsigned long port, unsigned int index,
if (index > 0x0d)
return -EINVAL;
save_flags(flags); cli();
spin_lock_irqsave(&ns87303_lock, flags);
outb(index, port);
value = inb(port + 1);
value &= ~(reserved[index] | clr);
value |= set;
outb(value, port + 1);
outb(value, port + 1);
restore_flags(flags);
spin_unlock_irqrestore(&ns87303_lock, flags);
return 0;
}
......
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__
/*
* AppleTalk networking structures
* AppleTalk networking structures
*
* The following are directly referenced from the University Of Michigan
* netatalk for compatibility reasons.
* The following are directly referenced from the University Of Michigan
* netatalk for compatibility reasons.
*/
#ifndef __LINUX_ATALK_H__
#define __LINUX_ATALK_H__
#define ATPORT_FIRST 1
#define ATPORT_RESERVED 128
#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
#define ATPORT_LAST 254 /* 254 is only legal on localtalk */
#define ATADDR_ANYNET (__u16)0
#define ATADDR_ANYNODE (__u8)0
#define ATADDR_ANYPORT (__u8)0
#define ATADDR_BCAST (__u8)255
#define DDP_MAXSZ 587
#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
#define DDP_MAXHOPS 15 /* 4 bits of hop counter */
#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
struct at_addr
{
struct atalk_addr {
__u16 s_net;
__u8 s_node;
};
struct sockaddr_at
{
sa_family_t sat_family;
__u8 sat_port;
struct at_addr sat_addr;
char sat_zero[ 8 ];
struct sockaddr_at {
sa_family_t sat_family;
__u8 sat_port;
struct atalk_addr sat_addr;
char sat_zero[8];
};
struct netrange
{
struct atalk_netrange {
__u8 nr_phase;
__u16 nr_firstnet;
__u16 nr_lastnet;
};
struct atalk_route
{
struct net_device *dev;
struct at_addr target;
struct at_addr gateway;
int flags;
struct atalk_route {
struct net_device *dev;
struct atalk_addr target;
struct atalk_addr gateway;
int flags;
struct atalk_route *next;
};
struct atalk_iface
{
struct net_device *dev;
struct at_addr address; /* Our address */
int status; /* What are we doing? */
/**
* struct atalk_iface - AppleTalk Interface
* @dev - Network device associated with this interface
* @address - Our address
* @status - What are we doing?
* @nets - Associated direct netrange
* @next - next element in the list of interfaces
*/
struct atalk_iface {
struct net_device *dev;
struct atalk_addr address;
int status;
#define ATIF_PROBE 1 /* Probing for an address */
#define ATIF_PROBE_FAIL 2 /* Probe collided */
struct netrange nets; /* Associated direct netrange */
struct atalk_iface *next;
struct atalk_netrange nets;
struct atalk_iface *next;
};
struct atalk_sock
{
unsigned short dest_net;
unsigned short src_net;
unsigned char dest_node;
unsigned char src_node;
unsigned char dest_port;
unsigned char src_port;
struct atalk_sock {
unsigned short dest_net;
unsigned short src_net;
unsigned char dest_node;
unsigned char src_node;
unsigned char dest_port;
unsigned char src_port;
};
#ifdef __KERNEL__
#include <asm/byteorder.h>
struct ddpehdr
{
struct ddpehdr {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 deh_len:10, deh_hops:4, deh_pad:2;
__u16 deh_len:10,
deh_hops:4,
deh_pad:2;
#else
__u16 deh_pad:2, deh_hops:4, deh_len:10;
__u16 deh_pad:2,
deh_hops:4,
deh_len:10;
#endif
__u16 deh_sum;
__u16 deh_dnet;
......@@ -92,30 +95,35 @@ struct ddpehdr
/* And netatalk apps expect to stick the type in themselves */
};
static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb)
{
return (struct ddpehdr *)skb->h.raw;
}
/*
* Don't drop the struct into the struct above. You'll get some
* surprise padding.
*/
struct ddpebits
{
struct ddpebits {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 deh_len:10, deh_hops:4, deh_pad:2;
__u16 deh_len:10,
deh_hops:4,
deh_pad:2;
#else
__u16 deh_pad:2, deh_hops:4, deh_len:10;
__u16 deh_pad:2,
deh_hops:4,
deh_len:10;
#endif
};
/*
* Short form header
*/
struct ddpshdr
{
/* Short form header */
struct ddpshdr {
#ifdef __LITTLE_ENDIAN_BITFIELD
__u16 dsh_len:10, dsh_pad:6;
__u16 dsh_len:10,
dsh_pad:6;
#else
__u16 dsh_pad:6, dsh_len:10;
__u16 dsh_pad:6,
dsh_len:10;
#endif
__u8 dsh_dport;
__u8 dsh_sport;
......@@ -123,9 +131,7 @@ struct ddpshdr
};
/* AppleTalk AARP headers */
struct elapaarp
{
struct elapaarp {
__u16 hw_type;
#define AARP_HW_TYPE_ETHERNET 1
#define AARP_HW_TYPE_TOKENRING 2
......@@ -147,30 +153,44 @@ struct elapaarp
__u8 pa_dst_node __attribute__ ((packed));
};
#define AARP_EXPIRY_TIME (5*60*HZ) /* Not specified - how long till we drop a resolved entry */
#define AARP_HASH_SIZE 16 /* Size of hash table */
#define AARP_TICK_TIME (HZ/5) /* Fast retransmission timer when resolving */
#define AARP_RETRANSMIT_LIMIT 10 /* Send 10 requests then give up (2 seconds) */
#define AARP_RESOLVE_TIME (10*HZ) /* Some value bigger than total retransmit time + a bit for last reply to appear and to stop continual requests */
static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb)
{
return (struct elapaarp *)skb->h.raw;
}
/* Not specified - how long till we drop a resolved entry */
#define AARP_EXPIRY_TIME (5 * 60 * HZ)
/* Size of hash table */
#define AARP_HASH_SIZE 16
/* Fast retransmission timer when resolving */
#define AARP_TICK_TIME (HZ / 5)
/* Send 10 requests then give up (2 seconds) */
#define AARP_RETRANSMIT_LIMIT 10
/*
* Some value bigger than total retransmit time + a bit for last reply to
* appear and to stop continual requests
*/
#define AARP_RESOLVE_TIME (10 * HZ)
extern struct datalink_proto *ddp_dl, *aarp_dl;
extern void aarp_proto_init(void);
/* Inter module exports */
/*
* Give a device find its atif control structure
*/
/* Inter module exports */
/* Give a device find its atif control structure */
static inline struct atalk_iface *atalk_find_dev(struct net_device *dev)
{
return dev->atalk_ptr;
}
extern struct at_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct at_addr *sa);
extern int aarp_send_ddp(struct net_device *dev,struct sk_buff *skb, struct at_addr *sa, void *hwaddr);
extern void aarp_send_probe(struct net_device *dev, struct at_addr *addr);
extern void aarp_device_down(struct net_device *dev);
extern struct atalk_addr *atalk_find_dev_addr(struct net_device *dev);
extern struct net_device *atrtr_get_dev(struct atalk_addr *sa);
extern int aarp_send_ddp(struct net_device *dev,
struct sk_buff *skb,
struct atalk_addr *sa, void *hwaddr);
extern void aarp_send_probe(struct net_device *dev,
struct atalk_addr *addr);
extern void aarp_device_down(struct net_device *dev);
#ifdef MODULE
extern void aarp_cleanup_module(void);
......
......@@ -96,6 +96,6 @@ struct ethhdr
unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
unsigned char h_source[ETH_ALEN]; /* source ether addr */
unsigned short h_proto; /* packet type ID field */
};
} __attribute__((packed));
#endif /* _LINUX_IF_ETHER_H */
......@@ -177,13 +177,23 @@ typedef void (*__cleanup_module_func_t)(void);
#define __devinitdata
#define __devexit
#define __devexitdata
#define __devexit_p(x) &(x)
#else
#define __devinit __init
#define __devinitdata __initdata
#define __devexit __exit
#define __devexitdata __exitdata
#define __devexit_p(x) 0
#endif
/* Functions marked as __devexit may be discarded at kernel link time, depending
on config options. Newer versions of binutils detect references from
retained sections to discarded sections and flag an error. Pointers to
__devexit functions must use __devexit_p(function_name), the wrapper will
insert either the function_name or NULL, depending on the config options.
*/
#if defined(MODULE) || defined(CONFIG_HOTPLUG)
#define __devexit_p(x) x
#else
#define __devexit_p(x) NULL
#endif
#endif /* _LINUX_INIT_H */
......@@ -24,15 +24,13 @@ struct sockaddr_ipx
#define IPX_DLTITF 0
#define IPX_CRTITF 1
typedef struct ipx_route_definition
{
struct ipx_route_definition {
__u32 ipx_network;
__u32 ipx_router_network;
unsigned char ipx_router_node[IPX_NODE_LEN];
} ipx_route_definition;
};
typedef struct ipx_interface_definition
{
struct ipx_interface_definition {
__u32 ipx_network;
unsigned char ipx_device[16];
unsigned char ipx_dlink_type;
......@@ -47,13 +45,12 @@ typedef struct ipx_interface_definition
#define IPX_PRIMARY 1
#define IPX_INTERNAL 2
unsigned char ipx_node[IPX_NODE_LEN];
} ipx_interface_definition;
};
typedef struct ipx_config_data
{
struct ipx_config_data {
unsigned char ipxcfg_auto_select_primary;
unsigned char ipxcfg_auto_create_interfaces;
} ipx_config_data;
};
/*
* OLD Route Definition for backward compatibility.
......@@ -77,13 +74,4 @@ struct ipx_route_def
#define SIOCAIPXPRISLT (SIOCPROTOPRIVATE+1)
#define SIOCIPXCFGDATA (SIOCPROTOPRIVATE+2)
#define SIOCIPXNCPCONN (SIOCPROTOPRIVATE+3)
#ifdef __KERNEL__
#include <linux/skbuff.h>
extern int ipxrtr_route_skb(struct sk_buff *);
extern int ipx_if_offset(unsigned long ipx_net_number);
extern void ipx_remove_socket(struct sock *sk);
#endif /* def __KERNEL__ */
#endif /* def _IPX_H_ */
......@@ -51,6 +51,10 @@
#define PORT_UART00 35
#define PORT_21285 37
/* Sparc type numbers. */
#define PORT_SUNZILOG 38
#define PORT_SUNSAB 39
#ifdef __KERNEL__
#include <linux/config.h>
......
......@@ -182,7 +182,6 @@ struct sk_buff {
struct icmphdr *icmph;
struct igmphdr *igmph;
struct iphdr *ipiph;
struct spxhdr *spxh;
unsigned char *raw;
} h;
......@@ -190,7 +189,6 @@ struct sk_buff {
struct iphdr *iph;
struct ipv6hdr *ipv6h;
struct arphdr *arph;
struct ipxhdr *ipxh;
unsigned char *raw;
} nh;
......
......@@ -14,12 +14,11 @@
#include <net/datalink.h>
#include <linux/ipx.h>
typedef struct
{
struct ipx_address {
__u32 net;
__u8 node[IPX_NODE_LEN];
__u16 sock;
} ipx_address;
};
#define ipx_broadcast_node "\377\377\377\377\377\377"
#define ipx_this_node "\0\0\0\0\0\0"
......@@ -39,11 +38,16 @@ struct ipxhdr
#define IPX_TYPE_SPX 0x05 /* SPX protocol */
#define IPX_TYPE_NCP 0x11 /* $lots for docs on this (SPIT) */
#define IPX_TYPE_PPROP 0x14 /* complicated flood fill brdcast */
ipx_address ipx_dest __attribute__ ((packed));
ipx_address ipx_source __attribute__ ((packed));
struct ipx_address ipx_dest __attribute__ ((packed));
struct ipx_address ipx_source __attribute__ ((packed));
};
typedef struct ipx_interface {
static __inline__ struct ipxhdr *ipx_hdr(struct sk_buff *skb)
{
return (struct ipxhdr *)skb->h.raw;
}
struct ipx_interface {
/* IPX address */
__u32 if_netnum;
unsigned char if_node[IPX_NODE_LEN];
......@@ -65,16 +69,16 @@ typedef struct ipx_interface {
unsigned char if_primary;
struct ipx_interface *if_next;
} ipx_interface;
};
typedef struct ipx_route {
struct ipx_route {
__u32 ir_net;
ipx_interface *ir_intrfc;
struct ipx_interface *ir_intrfc;
unsigned char ir_routed;
unsigned char ir_router_node[IPX_NODE_LEN];
struct ipx_route *ir_next;
struct ipx_route *ir_next;
atomic_t refcnt;
} ipx_route;
};
#ifdef __KERNEL__
struct ipx_cb {
......@@ -88,8 +92,8 @@ struct ipx_cb {
};
struct ipx_opt {
ipx_address dest_addr;
ipx_interface *intrfc;
struct ipx_address dest_addr;
struct ipx_interface *intrfc;
unsigned short port;
#ifdef CONFIG_IPX_INTERN
unsigned char node[IPX_NODE_LEN];
......@@ -106,7 +110,4 @@ struct ipx_opt {
#define IPX_MIN_EPHEMERAL_SOCKET 0x4000
#define IPX_MAX_EPHEMERAL_SOCKET 0x7fff
extern int ipx_register_spx(struct proto_ops **, struct net_proto_family *);
extern int ipx_unregister_spx(void);
#endif /* def _NET_INET_IPX_H_ */
This diff is collapsed.
......@@ -191,34 +191,34 @@
(info->ind_bits = ( (info->ind_bits & 0xEF) | (((u8) ind) & 0x10)))
/* Sequence-numbered PDU format (4 bytes in length) */
typedef struct llc_pdu_sn {
struct llc_pdu_sn {
u8 dsap;
u8 ssap;
u8 ctrl_1;
u8 ctrl_2;
} llc_pdu_sn_t;
};
/* Un-numbered PDU format (3 bytes in length) */
typedef struct llc_pdu_un {
struct llc_pdu_un {
u8 dsap;
u8 ssap;
u8 ctrl_1;
} llc_pdu_un_t;
};
/* LLC Type 1 XID command/response information fields format */
typedef struct llc_xid_info {
struct llc_xid_info {
u8 fmt_id; /* always 0x18 for LLC */
u8 type; /* different if NULL/non-NULL LSAP */
u8 rw; /* sender receive window */
} llc_xid_info_t;
};
/* LLC Type 2 FRMR response information field format */
typedef struct llc_frmr_info {
struct llc_frmr_info {
u16 rej_pdu_ctrl; /* bits 1-8 if U-PDU */
u8 curr_ssv; /* current send state variable val */
u8 curr_rsv; /* current receive state variable */
u8 ind_bits; /* indicator bits set with macro */
} llc_frmr_info_t;
};
extern void llc_pdu_set_cmd_rsp(struct sk_buff *skb, u8 type);
extern void llc_pdu_set_pf_bit(struct sk_buff *skb, u8 bit_value);
......@@ -246,7 +246,8 @@ extern int llc_pdu_init_as_xid_rsp(struct sk_buff *skb, u8 svcs_supported,
u8 rx_window);
extern int llc_pdu_init_as_test_rsp(struct sk_buff *skb,
struct sk_buff *ev_skb);
extern int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb, llc_pdu_sn_t *prev_pdu,
extern int llc_pdu_init_as_frmr_rsp(struct sk_buff *skb,
struct llc_pdu_sn *prev_pdu,
u8 f_bit, u8 vs, u8 vr, u8 vzyxw);
extern int llc_pdu_init_as_rr_rsp(struct sk_buff *skb, u8 f_bit, u8 nr);
extern int llc_pdu_init_as_rej_rsp(struct sk_buff *skb, u8 f_bit, u8 nr);
......
This diff is collapsed.
......@@ -87,12 +87,12 @@ int request_dma(unsigned int dmanr, const char * device_id)
void free_dma(unsigned int dmanr)
{
if (dmanr >= MAX_DMA_CHANNELS) {
printk("Trying to free DMA%d\n", dmanr);
printk(KERN_WARNING "Trying to free DMA%d\n", dmanr);
return;
}
if (xchg(&dma_chan_busy[dmanr].lock, 0) == 0) {
printk("Trying to free free DMA%d\n", dmanr);
printk(KERN_WARNING "Trying to free free DMA%d\n", dmanr);
return;
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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