You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(6) |
Sep
(2) |
Oct
(43) |
Nov
(4) |
Dec
(12) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
(78) |
Feb
(97) |
Mar
(29) |
Apr
(2) |
May
(22) |
Jun
(38) |
Jul
(11) |
Aug
(27) |
Sep
(40) |
Oct
(2) |
Nov
(17) |
Dec
(8) |
| 2002 |
Jan
|
Feb
(2) |
Mar
(1) |
Apr
(480) |
May
(456) |
Jun
(12) |
Jul
|
Aug
(1) |
Sep
|
Oct
(18) |
Nov
(3) |
Dec
(6) |
| 2003 |
Jan
|
Feb
(18) |
Mar
(1) |
Apr
|
May
(6) |
Jun
(147) |
Jul
(7) |
Aug
(3) |
Sep
(235) |
Oct
(10) |
Nov
(2) |
Dec
(1) |
| 2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Dave A. <ai...@us...> - 2002-04-13 16:09:22
|
Update of /cvsroot/linux-vax/kernel-2.4/arch/ppc/mm
In directory usw-pr-cvs1:/tmp/cvs-serv30376/arch/ppc/mm
Modified Files:
ppc_mmu.c
Log Message:
DA: 2.4.16 PPC changes no affect on VAX port
Index: ppc_mmu.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/arch/ppc/mm/ppc_mmu.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ppc_mmu.c 10 Apr 2002 15:04:12 -0000 1.1
+++ ppc_mmu.c 13 Apr 2002 16:09:15 -0000 1.2
@@ -304,6 +304,9 @@
if (Hash == 0 || nopreload)
return;
+ /* We only want HPTEs for linux PTEs that have _PAGE_ACCESSED set */
+ if (!pte_young(pte))
+ return;
mm = (address < TASK_SIZE)? vma->vm_mm: &init_mm;
pmd = pmd_offset(pgd_offset(mm, address), address);
if (!pmd_none(*pmd)) {
|
|
From: Andy P. <at...@us...> - 2002-04-11 20:02:26
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/agp
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/agp
Modified Files:
Makefile agp.h agpgart_be.c agpgart_fe.c
Log Message:
synch 2.4.15 commit 55
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:03:52 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 13:30:59 -0000 1.2
@@ -7,7 +7,7 @@
export-objs := agpgart_be.o
-multi-objs := agpgart.o
+list-multi := agpgart.o
agpgart-objs := agpgart_fe.o agpgart_be.o
obj-$(CONFIG_AGP) += agpgart.o
Index: agp.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agp.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agp.h 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agp.h 11 Apr 2002 13:30:59 -0000 1.2
@@ -92,7 +92,7 @@
u32 mode;
enum chipset_type type;
enum aper_size_type size_type;
- u32 *key_list;
+ unsigned long *key_list;
atomic_t current_memory_agp;
atomic_t agp_in_use;
int max_memory_agp; /* in number of pages */
@@ -101,6 +101,7 @@
int num_aperture_sizes;
int num_of_masks;
int capndx;
+ int cant_use_aperture;
/* Links to driver specific functions */
@@ -119,15 +120,22 @@
void (*free_by_type) (agp_memory *);
unsigned long (*agp_alloc_page) (void);
void (*agp_destroy_page) (unsigned long);
+ int (*suspend)(void);
+ void (*resume)(void);
+
};
#define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr))
#define OUTREG16(mmap, addr, val) __raw_writew((val), (mmap)+(addr))
-#define OUTREG8 (mmap, addr, val) __raw_writeb((val), (mmap)+(addr))
+#define OUTREG8(mmap, addr, val) __raw_writeb((val), (mmap)+(addr))
#define INREG32(mmap, addr) __raw_readl((mmap)+(addr))
#define INREG16(mmap, addr) __raw_readw((mmap)+(addr))
-#define INREG8 (mmap, addr) __raw_readb((mmap)+(addr))
+#define INREG8(mmap, addr) __raw_readb((mmap)+(addr))
+
+#define KB(x) ((x) * 1024)
+#define MB(x) (KB (KB (x)))
+#define GB(x) (MB (KB (x)))
#define CACHE_FLUSH agp_bridge.cache_flush
#define A_SIZE_8(x) ((aper_size_info_8 *) x)
@@ -142,10 +150,6 @@
#define A_IDXFIX() (A_SIZE_FIX(agp_bridge.aperture_sizes) + i)
#define MAXKEY (4096 * 32)
-#ifndef min
-#define min(a,b) (((a)<(b))?(a):(b))
-#endif
-
#define AGPGART_MODULE_NAME "agpgart"
#define PFX AGPGART_MODULE_NAME ": "
@@ -160,15 +164,33 @@
#ifndef PCI_DEVICE_ID_VIA_8363_0
#define PCI_DEVICE_ID_VIA_8363_0 0x0305
#endif
+#ifndef PCI_DEVICE_ID_VIA_82C694X_0
+#define PCI_DEVICE_ID_VIA_82C694X_0 0x0605
+#endif
#ifndef PCI_DEVICE_ID_INTEL_810_0
#define PCI_DEVICE_ID_INTEL_810_0 0x7120
#endif
+#ifndef PCI_DEVICE_ID_INTEL_830_M_0
+#define PCI_DEVICE_ID_INTEL_830_M_0 0x3575
+#endif
+#ifndef PCI_DEVICE_ID_INTEL_830_M_1
+#define PCI_DEVICE_ID_INTEL_830_M_1 0x3577
+#endif
+#ifndef PCI_DEVICE_ID_INTEL_820_0
+#define PCI_DEVICE_ID_INTEL_820_0 0x2500
+#endif
#ifndef PCI_DEVICE_ID_INTEL_840_0
#define PCI_DEVICE_ID_INTEL_840_0 0x1a21
#endif
+#ifndef PCI_DEVICE_ID_INTEL_845_0
+#define PCI_DEVICE_ID_INTEL_845_0 0x1a30
+#endif
#ifndef PCI_DEVICE_ID_INTEL_850_0
#define PCI_DEVICE_ID_INTEL_850_0 0x2530
#endif
+#ifndef PCI_DEVICE_ID_INTEL_860_0
+#define PCI_DEVICE_ID_INTEL_860_0 0x2532
+#endif
#ifndef PCI_DEVICE_ID_INTEL_810_DC100_0
#define PCI_DEVICE_ID_INTEL_810_DC100_0 0x7122
#endif
@@ -199,6 +221,12 @@
#ifndef PCI_DEVICE_ID_AMD_IRONGATE_0
#define PCI_DEVICE_ID_AMD_IRONGATE_0 0x7006
#endif
+#ifndef PCI_DEVICE_ID_AMD_761_0
+#define PCI_DEVICE_ID_AMD_761_0 0x700e
+#endif
+#ifndef PCI_DEVICE_ID_AMD_762_0
+#define PCI_DEVICE_ID_AMD_762_0 0x700C
+#endif
#ifndef PCI_VENDOR_ID_AL
#define PCI_VENDOR_ID_AL 0x10b9
#endif
@@ -232,14 +260,42 @@
#define INTEL_NBXCFG 0x50
#define INTEL_ERRSTS 0x91
+/* intel i830 registers */
+#define I830_GMCH_CTRL 0x52
+#define I830_GMCH_ENABLED 0x4
+#define I830_GMCH_MEM_MASK 0x1
+#define I830_GMCH_MEM_64M 0x1
+#define I830_GMCH_MEM_128M 0
+#define I830_GMCH_GMS_MASK 0x70
+#define I830_GMCH_GMS_DISABLED 0x00
+#define I830_GMCH_GMS_LOCAL 0x10
+#define I830_GMCH_GMS_STOLEN_512 0x20
+#define I830_GMCH_GMS_STOLEN_1024 0x30
+#define I830_GMCH_GMS_STOLEN_8192 0x40
+#define I830_RDRAM_CHANNEL_TYPE 0x03010
+#define I830_RDRAM_ND(x) (((x) & 0x20) >> 5)
+#define I830_RDRAM_DDT(x) (((x) & 0x18) >> 3)
+
+/* intel i820 registers */
+#define INTEL_I820_RDCR 0x51
+#define INTEL_I820_ERRSTS 0xc8
+
/* intel i840 registers */
#define INTEL_I840_MCHCFG 0x50
-#define INTEL_I840_ERRSTS 0xc8
+#define INTEL_I840_ERRSTS 0xc8
+
+/* intel i845 registers */
+#define INTEL_I845_AGPM 0x51
+#define INTEL_I845_ERRSTS 0xc8
/* intel i850 registers */
#define INTEL_I850_MCHCFG 0x50
#define INTEL_I850_ERRSTS 0xc8
+/* intel i860 registers */
+#define INTEL_I860_MCHCFG 0x50
+#define INTEL_I860_ERRSTS 0xc8
+
/* intel i810 registers */
#define I810_GMADDR 0x10
#define I810_MMADDR 0x14
@@ -258,6 +314,8 @@
#define I810_DRAM_ROW_0 0x00000001
#define I810_DRAM_ROW_0_SDRAM 0x00000001
+
+
/* VIA register */
#define VIA_APBASE 0x10
#define VIA_GARTCTRL 0x80
@@ -291,5 +349,24 @@
#define ALI_CACHE_FLUSH_CTRL 0xD0
#define ALI_CACHE_FLUSH_ADDR_MASK 0xFFFFF000
#define ALI_CACHE_FLUSH_EN 0x100
+
+/* Serverworks Registers */
+#define SVWRKS_APSIZE 0x10
+#define SVWRKS_SIZE_MASK 0xfe000000
+
+#define SVWRKS_MMBASE 0x14
+#define SVWRKS_CACHING 0x4b
+#define SVWRKS_FEATURE 0x68
+
+/* func 1 registers */
+#define SVWRKS_AGP_ENABLE 0x60
+#define SVWRKS_COMMAND 0x04
+
+/* Memory mapped registers */
+#define SVWRKS_GART_CACHE 0x02
+#define SVWRKS_GATTBASE 0x04
+#define SVWRKS_TLBFLUSH 0x10
+#define SVWRKS_POSTFLUSH 0x14
+#define SVWRKS_DIRFLUSH 0x0c
#endif /* _AGP_BACKEND_PRIV_H */
Index: agpgart_be.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agpgart_be.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agpgart_be.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agpgart_be.c 11 Apr 2002 13:30:59 -0000 1.2
@@ -38,6 +38,7 @@
#include <linux/init.h>
#include <linux/pagemap.h>
#include <linux/miscdevice.h>
+#include <linux/pm.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <asm/io.h>
@@ -48,6 +49,7 @@
MODULE_AUTHOR("Jeff Hartmann <jha...@pr...>");
MODULE_PARM(agp_try_unsupported, "1i");
[...2064 lines suppressed...]
+}
+
extern int agp_frontend_initialize(void);
extern void agp_frontend_cleanup(void);
@@ -2793,11 +4157,14 @@
}
inter_module_register("drm_agp", THIS_MODULE, &drm_agp);
+
+ pm_register(PM_PCI_DEV, PM_PCI_ID(agp_bridge.dev), agp_power);
return 0;
}
static void __exit agp_cleanup(void)
{
+ pm_unregister_all(agp_power);
agp_frontend_cleanup();
agp_backend_cleanup();
inter_module_unregister("drm_agp");
Index: agpgart_fe.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/agp/agpgart_fe.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- agpgart_fe.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ agpgart_fe.c 11 Apr 2002 13:30:59 -0000 1.2
@@ -749,11 +749,6 @@
}
-static long long agp_lseek(struct file *file, long long offset, int origin)
-{
- return -ESPIPE;
-}
-
static ssize_t agp_read(struct file *file, char *buf,
size_t count, loff_t * ppos)
{
@@ -852,6 +847,9 @@
if (copy_from_user(&reserve, (void *) arg, sizeof(agp_region))) {
return -EFAULT;
}
+ if ((unsigned) reserve.seg_count >= ~0U/sizeof(agp_segment))
+ return -EFAULT;
+
client = agp_find_client_by_pid(reserve.pid);
if (reserve.seg_count == 0) {
@@ -872,6 +870,9 @@
} else {
agp_segment *segment;
+ if (reserve.seg_count >= 16384)
+ return -EINVAL;
+
segment = kmalloc((sizeof(agp_segment) * reserve.seg_count),
GFP_KERNEL);
@@ -879,7 +880,7 @@
return -ENOMEM;
}
if (copy_from_user(segment, (void *) reserve.seg_list,
- GFP_KERNEL)) {
+ sizeof(agp_segment) * reserve.seg_count)) {
kfree(segment);
return -EFAULT;
}
@@ -1077,7 +1078,7 @@
static struct file_operations agp_fops =
{
owner: THIS_MODULE,
- llseek: agp_lseek,
+ llseek: no_llseek,
read: agp_read,
write: agp_write,
ioctl: agp_ioctl,
@@ -1105,7 +1106,8 @@
return 0;
}
-static void __exit agp_frontend_cleanup(void)
+void __exit agp_frontend_cleanup(void)
{
misc_deregister(&agp_miscdev);
}
+
|
|
From: Andy P. <at...@us...> - 2002-04-11 19:11:03
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/s390/misc
In directory usw-pr-cvs1:/tmp/cvs-serv8509/s390/misc
Modified Files:
Makefile chandev.c
Log Message:
synch 2.4.15 commit 52
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/misc/Makefile,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- Makefile 25 Feb 2001 23:15:14 -0000 1.1.1.2
+++ Makefile 11 Apr 2002 12:55:54 -0000 1.2
@@ -1,9 +1,10 @@
-all: s390-misc.o
+#
+# S/390 miscellaneous devices
+#
-CFLAFS +=
O_TARGET := s390-misc.o
obj-$(CONFIG_CHANDEV) += chandev.o
+export-objs += chandev.o
include $(TOPDIR)/Rules.make
-
Index: chandev.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/misc/chandev.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- chandev.c 25 Feb 2001 23:15:14 -0000 1.1.1.2
+++ chandev.c 11 Apr 2002 12:55:54 -0000 1.2
@@ -6,7 +6,10 @@
*
* Generic channel device initialisation support.
*/
+#define TRUE 1
+#define FALSE 0
#define __KERNEL_SYSCALLS__
+#include <linux/module.h>
#include <linux/config.h>
#include <linux/types.h>
#include <linux/ctype.h>
@@ -20,6 +23,15 @@
[...3228 lines suppressed...]
+
+
+int chandev_persist(chandev_type chan_type)
+{
+ return((chandev_persistent&chan_type) ? TRUE:FALSE);
+}
+
+EXPORT_SYMBOL(chandev_register_and_probe);
+EXPORT_SYMBOL(chandev_request_irq);
+EXPORT_SYMBOL(chandev_unregister);
+EXPORT_SYMBOL(chandev_initdevice);
+EXPORT_SYMBOL(chandev_build_device_name);
+EXPORT_SYMBOL(chandev_initnetdevice);
+EXPORT_SYMBOL(chandev_init_netdev);
+EXPORT_SYMBOL(chandev_use_devno_names);
+EXPORT_SYMBOL(chandev_free_irq);
+EXPORT_SYMBOL(chandev_add_model);
+EXPORT_SYMBOL(chandev_del_model);
+EXPORT_SYMBOL(chandev_persist);
|
|
From: Andy P. <at...@us...> - 2002-04-11 16:43:57
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/wan/lmc
Modified Files:
lmc_ioctl.h lmc_main.c lmc_media.c lmc_proto.c lmc_var.h
Log Message:
synch 2.4.15 commit 50
Index: lmc_ioctl.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_ioctl.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
Index: lmc_main.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_main.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- lmc_main.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ lmc_main.c 11 Apr 2002 12:37:52 -0000 1.2
@@ -67,7 +67,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include "../syncppp.h"
+#include <net/syncppp.h>
#include <linux/inet.h>
#if LINUX_VERSION_CODE >= 0x20200
@@ -77,15 +77,7 @@
#define ARPHRD_HDLC 513
#endif
-#ifdef MODULE
-#ifdef MODVERSIONS
-#include <linux/modversions.h>
-#endif
#include <linux/module.h>
-#else
-#define MOD_INC_USE_COUNT
-#define MOD_DEC_USE_COUNT
-#endif
#define DRIVER_MAJOR_VERSION 1
#define DRIVER_MINOR_VERSION 34
@@ -116,6 +108,8 @@
};
MODULE_DEVICE_TABLE(pci, lmc_pci_tbl);
+
+MODULE_LICENSE("GPL");
#endif
@@ -166,7 +160,7 @@
/*
* Most functions mess with the structure
- * Disable interupts while we do the polling
+ * Disable interrupts while we do the polling
*/
spin_lock_irqsave(&sc->lmc_lock, flags);
@@ -515,7 +509,12 @@
break;
}
- LMC_COPY_FROM_USER(data, xc.data, xc.len);
+ if(copy_from_user(data, xc.data, xc.len))
+ {
+ kfree(data);
+ ret = -ENOMEM;
+ break;
+ }
printk("%s: Starting load of data Len: %d at 0x%p == 0x%p\n", dev->name, xc.len, xc.data, data);
@@ -546,7 +545,7 @@
udelay(50);
/*
- * Clear reset and activate programing lines
+ * Clear reset and activate programming lines
* Reset: Input
* DP: Input
* Clock: Output
@@ -584,7 +583,7 @@
sc->lmc_gpio |= LMC_GEP_DATA; /* Data is 1 */
break;
default:
- printk(KERN_WARNING "%s Bad data in xilinx programing data at %d, got %d wanted 0 or 1\n", dev->name, pos, data[pos]);
+ printk(KERN_WARNING "%s Bad data in xilinx programming data at %d, got %d wanted 0 or 1\n", dev->name, pos, data[pos]);
sc->lmc_gpio |= LMC_GEP_DATA; /* Assume it's 1 */
}
sc->lmc_gpio &= ~LMC_GEP_CLK; /* Clock to zero */
@@ -598,13 +597,13 @@
udelay(1);
}
if((LMC_CSR_READ(sc, csr_gp) & LMC_GEP_INIT) == 0){
- printk(KERN_WARNING "%s: Reprograming FAILED. Needs to be reprogramed. (corrupted data)\n", dev->name);
+ printk(KERN_WARNING "%s: Reprogramming FAILED. Needs to be reprogrammed. (corrupted data)\n", dev->name);
}
else if((LMC_CSR_READ(sc, csr_gp) & LMC_GEP_DP) == 0){
- printk(KERN_WARNING "%s: Reprograming FAILED. Needs to be reprogramed. (done)\n", dev->name);
+ printk(KERN_WARNING "%s: Reprogramming FAILED. Needs to be reprogrammed. (done)\n", dev->name);
}
else {
- printk(KERN_DEBUG "%s: Done reprograming Xilinx, %d bits, good luck!\n", dev->name, pos);
+ printk(KERN_DEBUG "%s: Done reprogramming Xilinx, %d bits, good luck!\n", dev->name, pos);
}
lmc_gpio_mkinput(sc, 0xff);
@@ -662,12 +661,13 @@
if(sc->check != 0xBEAFCAFE){
printk("LMC: Corrupt net_device stuct, breaking out\n");
+ spin_unlock_irqrestore(&sc->lmc_lock, flags);
return;
}
/* Make sure the tx jabber and rx watchdog are off,
- * and the transmit and recieve processes are running.
+ * and the transmit and receive processes are running.
*/
LMC_CSR_WRITE (sc, csr_15, 0x00000011);
@@ -793,7 +793,7 @@
if(sc->failed_recv_alloc == 1){
/*
* We failed to alloc mem in the
- * interupt halder, go through the rings
+ * interrupt handler, go through the rings
* and rebuild them
*/
sc->failed_recv_alloc = 0;
@@ -1356,7 +1356,7 @@
/* Stop Tx and Rx on the chip */
csr6 = LMC_CSR_READ (sc, csr_command);
csr6 &= ~LMC_DEC_ST; /* Turn off the Transmission bit */
- csr6 &= ~LMC_DEC_SR; /* Turn off the Recieve bit */
+ csr6 &= ~LMC_DEC_SR; /* Turn off the Receive bit */
LMC_CSR_WRITE (sc, csr_command, csr6);
dev->flags &= ~IFF_RUNNING;
@@ -1425,7 +1425,7 @@
spin_lock(&sc->lmc_lock);
/*
- * Read the csr to find what interupts we have (if any)
+ * Read the csr to find what interrupts we have (if any)
*/
csr = LMC_CSR_READ (sc, csr_status);
@@ -1441,7 +1441,7 @@
/* always go through this loop at least once */
while (csr & sc->lmc_intrmask) {
/*
- * Clear interupt bits, we handle all case below
+ * Clear interrupt bits, we handle all case below
*/
LMC_CSR_WRITE (sc, csr_status, csr);
@@ -1464,7 +1464,7 @@
}
if (csr & TULIP_STS_RXINTR){
- lmc_trace(dev, "rx interupt");
+ lmc_trace(dev, "rx interrupt");
lmc_rx (dev);
}
@@ -1588,7 +1588,7 @@
/*
* Get current csr status to make sure
- * we've cleared all interupts
+ * we've cleared all interrupts
*/
csr = LMC_CSR_READ (sc, csr_status);
} /* end interrupt loop */
@@ -1599,8 +1599,6 @@
spin_unlock(&sc->lmc_lock);
lmc_trace(dev, "lmc_interrupt out");
-
- return;
}
static int lmc_start_xmit (struct sk_buff *skb, struct net_device *dev) /*fold00*/
@@ -1843,6 +1841,7 @@
dev->last_rx = jiffies;
sc->stats.rx_packets++;
+ sc->stats.rx_bytes += len;
LMC_CONSOLE_LOG("recv", skb->data, len);
@@ -1879,12 +1878,12 @@
sc->lmc_rxq[i] = nsb;
nsb->dev = dev;
sc->lmc_rxring[i].buffer1 = virt_to_bus (nsb->tail);
- /* Transfered to 21140 below */
+ /* Transferred to 21140 below */
}
else {
/*
* We've run out of memory, stop trying to allocate
- * memory and exit the interupt handler
+ * memory and exit the interrupt handler
*
* The chip may run out of receivers and stop
* in which care we'll try to allocate the buffer
@@ -2129,7 +2128,7 @@
lmc_trace(sc->lmc_device, "lmc_softreset in");
- /* Initialize the recieve rings and buffers. */
+ /* Initialize the receive rings and buffers. */
sc->lmc_txfull = 0;
sc->lmc_next_rx = 0;
sc->lmc_next_tx = 0;
@@ -2138,7 +2137,7 @@
/*
* Setup each one of the receiver buffers
- * allocate an skbuff for each one, setup the the descriptor table
+ * allocate an skbuff for each one, setup the descriptor table
* and point each buffer at the next one
*/
Index: lmc_media.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_media.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- lmc_media.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ lmc_media.c 11 Apr 2002 12:37:52 -0000 1.2
@@ -29,7 +29,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include "../syncppp.h"
+#include <net/syncppp.h>
#include <linux/inet.h>
#if LINUX_VERSION_CODE >= 0x20200
Index: lmc_proto.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_proto.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- lmc_proto.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ lmc_proto.c 11 Apr 2002 12:37:52 -0000 1.2
@@ -43,7 +43,7 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
-#include "../syncppp.h"
+#include <net/syncppp.h>
#include <linux/inet.h>
#include <linux/tqueue.h>
#include <linux/proc_fs.h>
@@ -61,7 +61,6 @@
* compiled without referencing any of the sync ppp routines.
*/
#ifdef SPPPSTUB
-#define SYNC_PPP_init() (void)0
#define SPPP_detach(d) (void)0
#define SPPP_open(d) 0
#define SPPP_reopen(d) (void)0
@@ -70,7 +69,6 @@
#define SPPP_do_ioctl(d,i,c) -EOPNOTSUPP
#else
#if LINUX_VERSION_CODE < 0x20363
-#define SYNC_PPP_init sync_ppp_init
#define SPPP_attach(x) sppp_attach((struct ppp_device *)(x)->lmc_device)
#define SPPP_detach(x) sppp_detach((x)->lmc_device)
#define SPPP_open(x) sppp_open((x)->lmc_device)
@@ -78,7 +76,6 @@
#define SPPP_close(x) sppp_close((x)->lmc_device)
#define SPPP_do_ioctl(x, y, z) sppp_do_ioctl((x)->lmc_device, (y), (z))
#else
-#define SYNC_PPP_init sync_ppp_init
#define SPPP_attach(x) sppp_attach((x)->pd)
#define SPPP_detach(x) sppp_detach((x)->pd->dev)
#define SPPP_open(x) sppp_open((x)->pd->dev)
@@ -88,21 +85,19 @@
#endif
#endif
-static int lmc_first_ppp_load = 0;
-
// init
void lmc_proto_init(lmc_softc_t *sc) /*FOLD00*/
{
lmc_trace(sc->lmc_device, "lmc_proto_init in");
switch(sc->if_type){
case LMC_PPP:
- if(lmc_first_ppp_load == 0)
-#ifndef MODULE
- SYNC_PPP_init();
-#endif
#if LINUX_VERSION_CODE >= 0x20363
sc->pd = kmalloc(sizeof(struct ppp_device), GFP_KERNEL);
+ if (!sc->pd) {
+ printk("lmc_proto_init(): kmalloc failure!\n");
+ return;
+ }
sc->pd->dev = sc->lmc_device;
#endif
sc->if_ptr = sc->pd;
Index: lmc_var.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/wan/lmc/lmc_var.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- lmc_var.h 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ lmc_var.h 11 Apr 2002 12:37:52 -0000 1.2
@@ -482,10 +482,10 @@
#define TULIP_STS_NORMALINTR 0x00010000L /* (RW) Normal Interrupt */
#define TULIP_STS_ABNRMLINTR 0x00008000L /* (RW) Abnormal Interrupt */
-#define TULIP_STS_ERI 0x00004000L /* (RW) Early Receive Interupt */
+#define TULIP_STS_ERI 0x00004000L /* (RW) Early Receive Interrupt */
#define TULIP_STS_SYSERROR 0x00002000L /* (RW) System Error */
#define TULIP_STS_GTE 0x00000800L /* (RW) General Pupose Timer Exp */
-#define TULIP_STS_ETI 0x00000400L /* (RW) Early Transmit Interupt */
+#define TULIP_STS_ETI 0x00000400L /* (RW) Early Transmit Interrupt */
#define TULIP_STS_RXWT 0x00000200L /* (RW) Receiver Watchdog Timeout */
#define TULIP_STS_RXSTOPPED 0x00000100L /* (RW) Receiver Process Stopped */
#define TULIP_STS_RXNOBUF 0x00000080L /* (RW) Receive Buf Unavail */
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/ftape/lowlevel
Modified Files:
Makefile fc-10.c fc-10.h fdc-io.c fdc-io.h fdc-isr.c fdc-isr.h
ftape-bsm.c ftape-bsm.h ftape-buffer.c ftape-buffer.h
ftape-calibr.c ftape-calibr.h ftape-ctl.c ftape-ctl.h
ftape-ecc.c ftape-ecc.h ftape-format.c ftape-format.h
ftape-init.c ftape-init.h ftape-io.c ftape-io.h ftape-proc.c
ftape-proc.h ftape-read.c ftape-read.h ftape-rw.c ftape-rw.h
ftape-setup.c ftape-tracing.c ftape-tracing.h ftape-write.c
ftape-write.h ftape_syms.c ftape_syms.h
Log Message:
synch 2.4.15 commit 55
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: fc-10.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fc-10.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: fc-10.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fc-10.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: fdc-io.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fdc-io.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: fdc-io.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fdc-io.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: fdc-isr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fdc-isr.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
Index: fdc-isr.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/fdc-isr.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-bsm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-bsm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-bsm.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-bsm.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-buffer.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-buffer.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
Index: ftape-buffer.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-buffer.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-calibr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-calibr.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ftape-calibr.c 14 Jan 2001 17:58:38 -0000 1.1.1.1
+++ ftape-calibr.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -31,7 +31,7 @@
#include <asm/io.h>
#if defined(__alpha__)
# include <asm/hwrpb.h>
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
# include <linux/timex.h>
#endif
#include <linux/ftape.h>
@@ -41,7 +41,7 @@
#undef DEBUG
-#if !defined(__alpha__) && !defined(__i386__)
+#if !defined(__alpha__) && !defined(__i386__) && !defined(__x86_64__)
# error Ftape is not implemented for this architecture!
#endif
@@ -70,7 +70,7 @@
asm volatile ("rpcc %0" : "=r" (r));
return r;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
unsigned long flags;
__u16 lo;
__u16 hi;
@@ -90,7 +90,7 @@
{
#if defined(__alpha__)
return ftape_timestamp();
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
unsigned int count;
unsigned long flags;
@@ -108,7 +108,7 @@
{
#if defined(__alpha__)
return (t1 <= t0) ? t1 + (1UL << 32) - t0 : t1 - t0;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
/*
* This is tricky: to work for both short and full ftape_timestamps
* we'll have to discriminate between these.
@@ -124,7 +124,7 @@
{
#if defined(__alpha__)
return (ps_per_cycle * count) / 1000000UL;
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
return (10000 * count) / ((CLOCK_TICK_RATE + 50) / 100);
#endif
}
@@ -164,7 +164,7 @@
static void init_clock(void)
{
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
unsigned int t;
int i;
TRACE_FUN(ft_t_any);
@@ -214,7 +214,7 @@
unsigned int tc = 0;
unsigned int count;
unsigned int time;
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
unsigned int old_tc = 0;
unsigned int old_count = 1;
unsigned int old_time = 1;
@@ -265,7 +265,7 @@
if (time >= 100*1000) {
break;
}
-#elif defined(__i386__)
+#elif defined(__i386__) || defined(__x86_64__)
/*
* increase the count until the resulting time nears 2/HZ,
* then the tc will drop sharply because we lose LATCH counts.
Index: ftape-calibr.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-calibr.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-ctl.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-ctl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-ctl.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-ctl.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-ecc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-ecc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-ecc.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-ecc.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-format.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-format.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-format.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-format.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-init.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-init.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ftape-init.c 14 Jan 2001 17:58:19 -0000 1.1.1.1
+++ ftape-init.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -153,6 +153,7 @@
"(c) 1996, 1997 Claus-Justus Heine (cl...@mo...)");
MODULE_DESCRIPTION(
"QIC-117 driver for QIC-40/80/3010/3020 floppy tape drives.");
+MODULE_LICENSE("GPL");
#endif
/* Called by modules package when installing the driver
Index: ftape-init.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-init.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-io.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-io.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-io.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-io.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-proc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-proc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-proc.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-proc.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-read.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-read.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-read.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-read.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-rw.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-rw.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-rw.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-rw.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-setup.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-setup.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-tracing.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-tracing.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-tracing.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-tracing.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-write.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-write.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape-write.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape-write.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape_syms.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape_syms.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: ftape_syms.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/lowlevel/ftape_syms.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
|
|
From: Andy P. <at...@us...> - 2002-04-11 15:52:47
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/ip2
Modified Files:
i2ellis.c i2ellis.h i2lib.c i2lib.h ip2.h
Log Message:
synch 2.4.15 commit 55
Index: i2ellis.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2/i2ellis.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- i2ellis.c 14 Jan 2001 18:00:25 -0000 1.1.1.1
+++ i2ellis.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -552,6 +552,9 @@
pB->i2eStartMail = iiGetMail(pB);
+ // Throw it away and clear the mailbox structure element
+ pB->i2eStartMail = NO_MAIL_HERE;
+
// Everything is ok now, return with good status/
pB->i2eValid = I2E_MAGIC;
@@ -592,14 +595,27 @@
static void
ii2DelayTimer(unsigned int mseconds)
{
+ wait_queue_t wait;
+
+ init_waitqueue_entry(&wait, current);
+
init_timer ( pDelayTimer );
+ add_wait_queue(&pDelayWait, &wait);
+
+ set_current_state( TASK_INTERRUPTIBLE );
+
pDelayTimer->expires = jiffies + ( mseconds + 9 ) / 10;
pDelayTimer->function = ii2DelayWakeup;
pDelayTimer->data = 0;
add_timer ( pDelayTimer );
- interruptible_sleep_on ( &pDelayWait );
+
+ schedule();
+
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&pDelayWait, &wait);
+
del_timer ( pDelayTimer );
}
Index: i2ellis.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2/i2ellis.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- i2ellis.h 14 Jan 2001 18:00:28 -0000 1.1.1.1
+++ i2ellis.h 11 Apr 2002 13:31:02 -0000 1.2
@@ -400,6 +400,12 @@
rwlock_t read_fifo_spinlock;
rwlock_t write_fifo_spinlock;
+// For queuing interupt bottom half handlers. /\/\|=mhw=|\/\/
+ struct tq_struct tqueue_interrupt;
+
+ struct timer_list SendPendingTimer; // Used by iiSendPending
+ unsigned int SendPendingRetry;
+
#ifdef CONFIG_DEVFS_FS
/* Device handles into devfs */
devfs_handle_t devfs_ipl_handle;
Index: i2lib.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2/i2lib.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- i2lib.c 14 Jan 2001 18:00:41 -0000 1.1.1.1
+++ i2lib.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -174,6 +174,25 @@
pB->i2eWaitingForEmptyFifo |=
(pB->i2eOutMailWaiting & MB_OUT_STUFFED);
pB->i2eOutMailWaiting = 0;
+ pB->SendPendingRetry = 0;
+ } else {
+/* The only time we hit this area is when "iiTrySendMail" has
+ failed. That only occurs when the outbound mailbox is
+ still busy with the last message. We take a short breather
+ to let the board catch up with itself and then try again.
+ 16 Retries is the limit - then we got a borked board.
+ /\/\|=mhw=|\/\/ */
+
+ if( ++pB->SendPendingRetry < 16 ) {
+
+ init_timer( &(pB->SendPendingTimer) );
+ pB->SendPendingTimer.expires = jiffies + 1;
+ pB->SendPendingTimer.function = (void*)(unsigned long)iiSendPendingMail;
+ pB->SendPendingTimer.data = (unsigned long)pB;
+ add_timer( &(pB->SendPendingTimer) );
+ } else {
+ printk( KERN_ERR "IP2: iiSendPendingMail unable to queue outbound mail\n" );
+ }
}
}
}
@@ -225,6 +244,8 @@
pB->i2Dbuf_strip = pB->i2Dbuf_stuff = 0;
pB->i2Bbuf_strip = pB->i2Bbuf_stuff = 0;
+ pB->SendPendingRetry = 0;
+
memset ( pCh, 0, sizeof (i2ChanStr) * nChannels );
for (index = stuffIndex = 0, ppCh = (i2ChanStrPtr *)(pB->i2Fbuf);
@@ -311,15 +332,15 @@
pCh->ClosingDelay = 5*HZ/10;
pCh->ClosingWaitTime = 30*HZ;
-#ifdef USE_IQ
// Initialize task queue objects
pCh->tqueue_input.routine = (void(*)(void*)) do_input;
pCh->tqueue_input.data = pCh;
pCh->tqueue_status.routine = (void(*)(void*)) do_status;
pCh->tqueue_status.data = pCh;
-#endif
+#ifdef IP2DEBUG_TRACE
pCh->trace = ip2trace;
+#endif
++pCh;
--nChannels;
@@ -535,9 +556,9 @@
if ( !i2Validate ( pCh ) ) {
return -1;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, ITRC_ENTER, 0 );
-#endif
+
pB = pCh->pMyBord;
// Board must also exist, and THE INTERRUPT COMMAND ALREADY SENT
@@ -615,9 +636,9 @@
if (--bufroom < 0) {
bufroom += maxBuff;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, 2, 1, bufroom );
-#endif
+
// Check for overflow
if (totalsize <= bufroom) {
// Normal Expected path - We still hold LOCK
@@ -625,9 +646,8 @@
}
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_QUEUE, 3, 1, totalsize );
-#endif
+
// Prepare to wait for buffers to empty
WRITE_UNLOCK_IRQRESTORE(lock_var_p,flags);
serviceOutgoingFifo(pB); // Dump what we got
@@ -649,9 +669,8 @@
return 0; // Wake up! Time to die!!!
}
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
-#endif
+ ip2trace (CHANN, ITRC_QUEUE, 4, 0 );
+
} // end of for(;;)
// At this point we have room and the lock - stick them in.
@@ -673,9 +692,9 @@
// pCs->cmd[0].
if (pCs == CMD_BMARK_REQ) {
pCh->bookMarks++;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_DRAIN, 30, 1, pCh->bookMarks );
-#endif
+
}
cnt = pCs->length;
@@ -683,9 +702,9 @@
// if the last command had to be at the end of a block, we end
// the existing block here and start a new one.
if ((blocksize + cnt > maxBlock) || lastended) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, 5, 0 );
-#endif
+
PTYPE_OF(pInsert) = type;
CHANNEL_OF(pInsert) = channel;
// count here does not include the header
@@ -747,9 +766,9 @@
i2QueueNeeds(pB, pCh, NEED_BYPASS);
break;
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_QUEUE, ITRC_RETURN, 1, nCommands );
-#endif
+
return nCommands; // Good status: number of commands sent
}
@@ -772,9 +791,7 @@
unsigned short status;
i2eBordStrPtr pB;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, ITRC_ENTER, 2, pCh->dataSetIn, resetBits );
-#endif
// Make sure the channel exists, otherwise do nothing */
if ( !i2Validate ( pCh ) )
@@ -792,9 +809,7 @@
pCh->dataSetIn &= ~(I2_DDCD | I2_DCTS | I2_DDSR | I2_DRI);
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_STATUS, ITRC_RETURN, 1, pCh->dataSetIn );
-#endif
return status;
}
@@ -819,9 +834,7 @@
int count;
unsigned long flags = 0;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, ITRC_ENTER, 0);
-#endif
// Ensure channel structure seems real
if ( !i2Validate( pCh ) ) {
@@ -887,9 +900,8 @@
i2Input_exit:
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, ITRC_RETURN, 1, count);
-#endif
+
return count;
}
@@ -913,9 +925,7 @@
if ( !i2Validate ( pCh ) )
return -1;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_INPUT, 10, 0);
-#endif
WRITE_LOCK_IRQSAVE(&pCh->Ibuf_spinlock,flags);
count = pCh->Ibuf_stuff - pCh->Ibuf_strip;
@@ -943,9 +953,9 @@
} else {
WRITE_UNLOCK_IRQRESTORE(&pCh->Ibuf_spinlock,flags);
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_INPUT, 19, 1, count);
-#endif
+
return count;
}
@@ -1015,9 +1025,7 @@
int bailout = 10;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, ITRC_ENTER, 2, count, user );
-#endif
// Ensure channel structure seems real
if ( !i2Validate ( pCh ) )
@@ -1064,9 +1072,8 @@
// Small WINDOW here with no LOCK but I can't call Flush with LOCK
// We would be flushing (or ending flush) anyway
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 10, 1, amountToMove );
+
if ( !(pCh->flush_flags && i2RetryFlushOutput(pCh) )
&& amountToMove > 0 )
{
@@ -1104,9 +1111,7 @@
WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 13, 1, stuffIndex );
-#endif
} else {
@@ -1114,25 +1119,23 @@
// becuz we need to stuff a flush
// or amount to move is <= 0
-#ifdef IP2DEBUG_TRACE
ip2trace(CHANN, ITRC_OUTPUT, 14, 3,
- amountToMove, pB->i2eFifoRemains, pB->i2eWaitingForEmptyFifo );
-#endif
+ amountToMove, pB->i2eFifoRemains,
+ pB->i2eWaitingForEmptyFifo );
+
// Put this channel back on queue
// this ultimatly gets more data or wakes write output
i2QueueNeeds(pB, pCh, NEED_INLINE);
if ( pB->i2eWaitingForEmptyFifo ) {
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 16, 0 );
-#endif
+
// or schedule
if (!in_interrupt()) {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 61, 0 );
+
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(2);
if (signal_pending(current)) {
@@ -1140,9 +1143,9 @@
}
continue;
} else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
-#endif
+
+ ip2trace (CHANN, ITRC_OUTPUT, 62, 0 );
+
// let interrupt in = WAS restore_flags()
// We hold no lock nor is irq off anymore???
@@ -1152,31 +1155,31 @@
}
else if ( pB->i2eFifoRemains < 32 && !pB->i2eTxMailEmpty ( pB ) )
{
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 19, 2, pB->i2eFifoRemains,
- pB->i2eTxMailEmpty );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 19, 2,
+ pB->i2eFifoRemains,
+ pB->i2eTxMailEmpty );
+
break; // from while(count)
} else if ( pCh->channelNeeds & NEED_CREDIT ) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, 22, 0 );
-#endif
+
break; // from while(count)
} else if ( --bailout) {
// Try to throw more things (maybe not us) in the fifo if we're
// not already waiting for it.
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_OUTPUT, 20, 0 );
-#endif
+
serviceOutgoingFifo(pB);
//break; CONTINUE;
} else {
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_OUTPUT, 21, 3, pB->i2eFifoRemains,
- pB->i2eOutMailWaiting, pB->i2eWaitingForEmptyFifo );
-#endif
+ ip2trace (CHANN, ITRC_OUTPUT, 21, 3,
+ pB->i2eFifoRemains,
+ pB->i2eOutMailWaiting,
+ pB->i2eWaitingForEmptyFifo );
+
break; // from while(count)
}
}
@@ -1187,14 +1190,13 @@
// We drop through either when the count expires, or when there is some
// count left, but there was a non-blocking write.
if (countOriginal > count) {
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, 17, 2, countOriginal, count );
-#endif
+
serviceOutgoingFifo( pB );
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_OUTPUT, ITRC_RETURN, 2, countOriginal, count );
-#endif
return countOriginal - count;
}
@@ -1213,23 +1215,20 @@
i2FlushOutput(i2ChanStrPtr pCh)
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 1, 1, pCh->flush_flags );
-#endif
if (pCh->flush_flags)
return;
if ( 1 != i2QueueCommands(PTYPE_BYPASS, pCh, 0, 1, CMD_STARTFL) ) {
pCh->flush_flags = STARTFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 2, 0 );
-#endif
+
} else if ( 1 != i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) ) {
pCh->flush_flags = STOPFL_FLAG; // Failed - flag for later
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 3, 0 );
-#endif
}
}
@@ -1238,9 +1237,7 @@
{
int old_flags = pCh->flush_flags;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 14, 1, old_flags );
-#endif
pCh->flush_flags = 0; // Clear flag so we can avoid recursion
// and queue the commands
@@ -1251,23 +1248,21 @@
} else {
old_flags = STARTFL_FLAG; //Failure - Flag for retry later
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 15, 1, old_flags );
-#endif
+
}
if ( old_flags & STOPFL_FLAG ) {
if ( 1 == i2QueueCommands(PTYPE_INLINE, pCh, 0, 1, CMD_STOPFL) > 0 ) {
old_flags = 0; // Success - clear flags
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_FLUSH, 16, 1, old_flags );
-#endif
}
- pCh->flush_flags = old_flags;
+ pCh->flush_flags = old_flags;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_FLUSH, 17, 1, old_flags );
-#endif
+
return old_flags;
}
@@ -1284,9 +1279,8 @@
static void
i2DrainWakeup(i2ChanStrPtr pCh)
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, 10, 1, pCh->BookmarkTimer.expires );
-#endif
+
pCh->BookmarkTimer.expires = 0;
wake_up_interruptible( &pCh->pBookmarkWait );
}
@@ -1294,11 +1288,11 @@
static void
i2DrainOutput(i2ChanStrPtr pCh, int timeout)
{
+ wait_queue_t wait;
i2eBordStrPtr pB;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, ITRC_ENTER, 1, pCh->BookmarkTimer.expires);
-#endif
+
pB = pCh->pMyBord;
// If the board has gone fatal, return bad,
// and also hit the trap routine if it exists.
@@ -1315,31 +1309,35 @@
pCh->BookmarkTimer.function = (void*)(unsigned long)i2DrainWakeup;
pCh->BookmarkTimer.data = (unsigned long)pCh;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, 1, 1, pCh->BookmarkTimer.expires );
-#endif
add_timer( &(pCh->BookmarkTimer) );
}
i2QueueCommands( PTYPE_INLINE, pCh, -1, 1, CMD_BMARK_REQ );
+
+ init_waitqueue_entry(&wait, current);
+ add_wait_queue(&(pCh->pBookmarkWait), &wait);
+ set_current_state( TASK_INTERRUPTIBLE );
+
serviceOutgoingFifo( pB );
- interruptible_sleep_on( &(pCh->pBookmarkWait) );
+ schedule(); // Now we take our interruptible sleep on
+
+ // Clean up the queue
+ set_current_state( TASK_RUNNING );
+ remove_wait_queue(&(pCh->pBookmarkWait), &wait);
// if expires == 0 then timer poped, then do not need to del_timer
if ((timeout > 0) && pCh->BookmarkTimer.expires &&
(pCh->BookmarkTimer.expires > jiffies)) {
del_timer( &(pCh->BookmarkTimer) );
pCh->BookmarkTimer.expires = 0;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_DRAIN, 3, 1, pCh->BookmarkTimer.expires );
-#endif
}
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_DRAIN, ITRC_RETURN, 1, pCh->BookmarkTimer.expires );
-#endif
return;
}
@@ -1384,17 +1382,17 @@
pCh = tp->driver_data;
-#ifdef IP2DEBUG_TRACE
- ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags, (1 << TTY_DO_WRITE_WAKEUP) );
-#endif
+ ip2trace (CHANN, ITRC_SICMD, 10, 2, tp->flags,
+ (1 << TTY_DO_WRITE_WAKEUP) );
+
wake_up_interruptible ( &tp->write_wait );
if ( ( tp->flags & (1 << TTY_DO_WRITE_WAKEUP) )
&& tp->ldisc.write_wakeup )
{
(tp->ldisc.write_wakeup) ( tp );
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 11, 0 );
-#endif
+
}
}
@@ -1480,14 +1478,11 @@
unsigned char dss_change;
unsigned long bflags,cflags;
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_ENTER, 0 );
while (HAS_INPUT(pB)) {
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 2, 0 );
+
// Process packet from fifo a one atomic unit
WRITE_LOCK_IRQSAVE(&pB->read_fifo_spinlock,bflags);
@@ -1500,9 +1495,8 @@
case PTYPE_DATA:
pB->got_input = 1;
-#ifdef IP2DEBUG_TRACE
- //ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
-#endif
+// ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 3, 0 );
+
channel = CHANNEL_OF(pB->i2eLeadoffWord); /* Store channel */
count = iiReadWord(pB); /* Count is in the next word */
@@ -1602,9 +1596,7 @@
break; // From switch: ready for next packet
case PTYPE_STATUS:
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 4, 0 );
-#endif
count = CMD_COUNT_OF(pB->i2eLeadoffWord);
@@ -1617,9 +1609,9 @@
while (pc < pcLimit) {
channel = *pc++;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_SFIFO, 7, 2, channel, *pc );
-#endif
+
/* check for valid channel */
if (channel < pB->i2eChannelCnt
&&
@@ -1652,41 +1644,32 @@
break;
case STAT_DCD_UP:
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 1, 1, pCh->dataSetIn );
-#endif
+
if ( !(pCh->dataSetIn & I2_DCD) )
{
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_MODEM, 2, 0 );
-#endif
pCh->dataSetIn |= I2_DDCD;
pCh->icount.dcd++;
dss_change = 1;
}
pCh->dataSetIn |= I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_MODEM, 3, 1, pCh->dataSetIn );
-#endif
break;
case STAT_DCD_DN:
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 4, 1, pCh->dataSetIn );
-#endif
if ( pCh->dataSetIn & I2_DCD )
{
-#ifdef IP2DEBUG_TRACE
ip2trace (channel, ITRC_MODEM, 5, 0 );
-#endif
pCh->dataSetIn |= I2_DDCD;
pCh->icount.dcd++;
dss_change = 1;
}
pCh->dataSetIn &= ~I2_DCD;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_MODEM, 6, 1, pCh->dataSetIn );
-#endif
break;
case STAT_DSR_UP:
@@ -1742,9 +1725,8 @@
if (pCh->bookMarks <= 0 ) {
pCh->bookMarks = 0;
wake_up_interruptible( &pCh->pBookmarkWait );
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_DRAIN, 20, 1, pCh->BookmarkTimer.expires );
-#endif
}
break;
@@ -1754,22 +1736,21 @@
pCh->outfl.room =
((flowStatPtr)pc)->room -
(pCh->outfl.asof - ((flowStatPtr)pc)->asof);
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_STFLW, 1, 1, pCh->outfl.room );
-#endif
+
if (pCh->channelNeeds & NEED_CREDIT)
{
-#ifdef IP2DEBUG_TRACE
- ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
-#endif
+ ip2trace (channel, ITRC_STFLW, 2, 1, pCh->channelNeeds);
+
pCh->channelNeeds &= ~NEED_CREDIT;
i2QueueNeeds(pB, pCh, NEED_INLINE);
if ( pCh->pTTY )
ip2_owake(pCh->pTTY);
}
-#ifdef IP2DEBUG_TRACE
+
ip2trace (channel, ITRC_STFLW, 3, 1, pCh->channelNeeds);
-#endif
+
pc += sizeof(flowStat);
break;
@@ -1865,16 +1846,15 @@
break;
default: // Neither packet? should be impossible
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, 5, 1,
PTYPE_OF(pB->i2eLeadoffWord) );
-#endif
+
break;
} // End of switch on type of packets
} //while(board HAS_INPUT)
-#ifdef IP2DEBUG_TRACE
+
ip2trace (ITRC_NO_PORT, ITRC_SFIFO, ITRC_RETURN, 0 );
-#endif
+
// Send acknowledgement to the board even if there was no data!
pB->i2eOutMailWaiting |= MB_IN_STRIPPED;
return;
@@ -1992,9 +1972,8 @@
i2ChanStrPtr pCh;
unsigned short paddedSize = ROUNDUP(sizeof(flowIn));
-#ifdef IP2DEBUG_TRACE
-ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+ ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_ENTER, 2,
+ pB->i2eFifoRemains, paddedSize );
// Continue processing so long as there are entries, or there is room in the
// fifo. Each entry represents a channel with something to do.
@@ -2006,14 +1985,12 @@
break;
}
#ifdef DEBUG_FIFO
-WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
+ WriteDBGBuf("FLOW",(unsigned char *) &(pCh->infl), paddedSize);
#endif /* DEBUG_FIFO */
} // Either clogged or finished all the work
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SFLOW, ITRC_RETURN, 0 );
-#endif
}
//******************************************************************************
@@ -2041,10 +2018,8 @@
int bailout = 1000;
int bailout2;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_ENTER, 3, pB->i2eFifoRemains,
pB->i2Dbuf_strip, pB->i2Dbuf_stuff );
-#endif
// Continue processing so long as there are entries, or there is room in the
// fifo. Each entry represents a channel with something to do.
@@ -2054,9 +2029,8 @@
WRITE_LOCK_IRQSAVE(&pCh->Obuf_spinlock,flags);
stripIndex = pCh->Obuf_strip;
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_SICMD, 3, 2, stripIndex, pCh->Obuf_stuff );
-#endif
+
// as long as there are packets for this channel...
bailout2 = 1000;
while ( --bailout2 && stripIndex != pCh->Obuf_stuff) {
@@ -2075,16 +2049,15 @@
flowsize = CREDIT_USAGE(flowsize);
paddedSize = ROUNDUP(packetSize);
-#ifdef IP2DEBUG_TRACE
ip2trace (CHANN, ITRC_SICMD, 4, 2, pB->i2eFifoRemains, paddedSize );
-#endif
+
// If we don't have enough credits from the board to send the data,
// flag the channel that we are waiting for flow control credit, and
// break out. This will clean up this channel and remove us from the
// queue of hot things to do.
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 5, 2, pCh->outfl.room, flowsize );
-#endif
+
if (pCh->outfl.room <= flowsize) {
// Do Not have the credits to send this packet.
i2QueueNeeds(pB, pCh, NEED_CREDIT);
@@ -2112,15 +2085,15 @@
}
pRemove += packetSize;
stripIndex += packetSize;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 6, 2, stripIndex, pCh->Obuf_strip);
-#endif
+
if (stripIndex >= OBUF_SIZE) {
stripIndex = 0;
pRemove = pCh->Obuf;
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 7, 1, stripIndex );
-#endif
+
}
} /* while */
if ( !bailout2 ) {
@@ -2132,23 +2105,20 @@
WRITE_UNLOCK_IRQRESTORE(&pCh->Obuf_spinlock,flags);
if ( notClogged )
{
-#ifdef IP2DEBUG_TRACE
+
ip2trace (CHANN, ITRC_SICMD, 8, 0 );
-#endif
+
if ( pCh->pTTY ) {
ip2_owake(pCh->pTTY);
}
}
} // Either clogged or finished all the work
-#ifdef IP2DEBUG_TRACE
+
if ( !bailout ) {
ip2trace (ITRC_NO_PORT, ITRC_ERROR, 4, 0 );
}
-#endif
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_SICMD, ITRC_RETURN, 1,pB->i2Dbuf_strip);
-#endif
}
//******************************************************************************
@@ -2212,11 +2182,13 @@
unsigned long flags;
- inmail = iiGetMail(pB);
+ /* This should be atomic because of the way we are called... */
+ if (NO_MAIL_HERE == ( inmail = pB->i2eStartMail ) ) {
+ inmail = iiGetMail(pB);
+ }
+ pB->i2eStartMail = NO_MAIL_HERE;
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 2, 1, inmail );
-#endif
if (inmail != NO_MAIL_HERE) {
// If the board has gone fatal, nothing to do but hit a bit that will
@@ -2238,16 +2210,14 @@
pB->i2eFifoRemains = pB->i2eFifoSize;
pB->i2eWaitingForEmptyFifo = 0;
WRITE_UNLOCK_IRQRESTORE(&pB->write_fifo_spinlock,flags);
-#ifdef IP2DEBUG_TRACE
- ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
-#endif
+
+ ip2trace (ITRC_NO_PORT, ITRC_INTR, 30, 1, pB->i2eFifoRemains );
+
}
serviceOutgoingFifo(pB);
}
-#ifdef IP2DEBUG_TRACE
ip2trace (ITRC_NO_PORT, ITRC_INTR, 8, 0 );
-#endif
exit_i2ServiceBoard:
Index: i2lib.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2/i2lib.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- i2lib.h 25 Feb 2001 23:15:03 -0000 1.1.1.2
+++ i2lib.h 11 Apr 2002 13:31:02 -0000 1.2
@@ -341,6 +341,12 @@
static int i2ServiceBoard(i2eBordStrPtr);
static void i2DrainOutput(i2ChanStrPtr, int);
+#ifdef IP2DEBUG_TRACE
+void ip2trace(unsigned short,unsigned char,unsigned char,unsigned long,...);
+#else
+#define ip2trace(a,b,c,d...) do {} while (0)
+#endif
+
// Argument to i2QueueCommands
//
#define C_IN_LINE 1
Index: ip2.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ip2/ip2.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ip2.h 14 Jan 2001 18:00:46 -0000 1.1.1.1
+++ ip2.h 11 Apr 2002 13:31:02 -0000 1.2
@@ -94,10 +94,20 @@
* /etc/modules.conf and load with modprobe, kerneld or kmod, the kernel
* module loader
*/
+
+ /* This structure is NOW always initialized when the driver is initialized.
+ * Compiled in defaults MUST be added to the io and irq arrays in
+ * ip2.c. Those values are configurable from insmod parameters in the
+ * case of modules or from command line parameters (ip2=io,irq) when
+ * compiled in.
+ */
+
static ip2config_t ip2config =
{
{0,0,0,0}, // irqs
{ // Addresses
+ /* Do NOT set compile time defaults HERE! Use the arrays in
+ ip2.c! These WILL be overwritten! =mhw= */
0x0000, // Board 0, ttyF0 - ttyF63
0x0000, // Board 1, ttyF64 - ttyF127
0x0000, // Board 2, ttyF128 - ttyF191
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/ftape/zftape
Modified Files:
Makefile zftape-buffers.c zftape-buffers.h zftape-ctl.c
zftape-ctl.h zftape-eof.c zftape-eof.h zftape-init.c
zftape-init.h zftape-read.c zftape-read.h zftape-rw.c
zftape-rw.h zftape-vtbl.c zftape-vtbl.h zftape-write.c
zftape-write.h zftape_syms.c zftape_syms.h
Log Message:
synch 2.4.15 commit 55
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-buffers.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-buffers.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
Index: zftape-buffers.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-buffers.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-ctl.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-ctl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-ctl.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-ctl.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-eof.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-eof.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-eof.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-eof.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-init.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-init.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- zftape-init.c 25 Feb 2001 23:15:03 -0000 1.1.1.2
+++ zftape-init.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -59,6 +59,7 @@
"Support for QIC-113 compatible volume table "
"and builtin compression (lzrw3 algorithm)");
MODULE_SUPPORTED_DEVICE("char-major-27");
+MODULE_LICENSE("GPL");
/* Global vars.
*/
Index: zftape-init.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-init.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-read.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-read.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-read.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-read.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-rw.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-rw.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-rw.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-rw.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-vtbl.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-vtbl.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- zftape-vtbl.c 25 Feb 2001 23:15:03 -0000 1.1.1.2
+++ zftape-vtbl.c 11 Apr 2002 13:31:02 -0000 1.2
@@ -431,7 +431,7 @@
/* this functions translates the failed_sector_log, misused as
* EOF-marker list, into a virtual volume table. The table mustn't be
* written to tape, because this would occupy the first data segment,
- * which should be the volume table, but is actualy the first segment
+ * which should be the volume table, but is actually the first segment
* that is filled with data (when using standard ftape). We assume,
* that we get a non-empty failed_sector_log.
*/
Index: zftape-vtbl.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-vtbl.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-write.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-write.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-write.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape-write.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape_syms.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape_syms.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape_syms.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/zftape/zftape_syms.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:49
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/soundmodem
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/hamradio/soundmodem
Modified Files:
gentbl.c sm.c sm.h sm_wss.c
Log Message:
synch 2.4.15 commit 50
Index: gentbl.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/soundmodem/gentbl.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- gentbl.c 14 Jan 2001 17:39:39 -0000 1.1.1.1
+++ gentbl.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -26,6 +26,7 @@
*/
#include <stdio.h>
+#include <stdlib.h>
#include <math.h>
#include <string.h>
Index: sm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/soundmodem/sm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sm.c 14 Jan 2001 17:39:42 -0000 1.1.1.1
+++ sm.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -728,7 +728,7 @@
static int __init sm_setup(char *str)
{
- static unsigned nr_dev = 0;
+ static unsigned nr_dev;
int ints[8];
if (nr_dev >= NR_PORTS)
Index: sm.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/soundmodem/sm.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sm.h 14 Jan 2001 17:39:48 -0000 1.1.1.1
+++ sm.h 11 Apr 2002 12:37:48 -0000 1.2
@@ -150,11 +150,6 @@
/* --------------------------------------------------------------------- */
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
-
extern const char sm_drvname[];
extern const char sm_drvinfo[];
@@ -299,6 +294,8 @@
#ifdef __i386__
+#include <asm/msr.h>
+
/*
* only do 32bit cycle counter arithmetic; we hope we won't overflow.
* in fact, overflowing modems would require over 2THz CPU clock speeds :-)
@@ -307,10 +304,10 @@
#define time_exec(var,cmd) \
({ \
if (cpu_has_tsc) { \
- unsigned int cnt1, cnt2, cnt3; \
- __asm__(".byte 0x0f,0x31" : "=a" (cnt1), "=d" (cnt3)); \
+ unsigned int cnt1, cnt2; \
+ rdtscl(cnt1); \
cmd; \
- __asm__(".byte 0x0f,0x31" : "=a" (cnt2), "=d" (cnt3)); \
+ rdtscl(cnt2); \
var = cnt2-cnt1; \
} else { \
cmd; \
Index: sm_wss.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/soundmodem/sm_wss.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sm_wss.c 14 Jan 2001 17:39:57 -0000 1.1.1.1
+++ sm_wss.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -172,8 +172,10 @@
/* MCE and interface config reg */
write_codec(dev, 0x49, fdx ? 0x8 : 0xc);
outb(0xb, WSS_CODEC_IA(dev->base_addr)); /* leave MCE */
- if (SCSTATE->crystal && !fullcalib)
+ if (SCSTATE->crystal && !fullcalib) {
+ restore_flags(flags);
return 0;
+ }
/*
* wait for ACI start
*/
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:49
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/hamradio
Modified Files:
6pack.c baycom_epp.c baycom_par.c baycom_ser_fdx.c
baycom_ser_hdx.c bpqether.c dmascc.c hdlcdrv.c mkiss.c scc.c
yam.c
Log Message:
synch 2.4.15 commit 50
Index: 6pack.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/6pack.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- 6pack.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ 6pack.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -699,10 +699,10 @@
/* Initialize 6pack control device -- register 6pack line discipline */
-static const char msg_banner[] __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n";
-static const char msg_invparm[] __initdata = KERN_ERR "6pack: sixpack_maxdev parameter too large.\n";
-static const char msg_nomem[] __initdata = KERN_ERR "6pack: can't allocate sixpack_ctrls[] array! No 6pack available.\n";
-static const char msg_regfail[] __initdata = KERN_ERR "6pack: can't register line discipline (err = %d)\n";
+static char msg_banner[] __initdata = KERN_INFO "AX.25: 6pack driver, " SIXPACK_VERSION " (dynamic channels, max=%d)\n";
+static char msg_invparm[] __initdata = KERN_ERR "6pack: sixpack_maxdev parameter too large.\n";
+static char msg_nomem[] __initdata = KERN_ERR "6pack: can't allocate sixpack_ctrls[] array! No 6pack available.\n";
+static char msg_regfail[] __initdata = KERN_ERR "6pack: can't register line discipline (err = %d)\n";
static int __init sixpack_init_driver(void)
{
@@ -711,10 +711,6 @@
/* Do sanity checks on maximum device parameter. */
if (sixpack_maxdev < 4)
sixpack_maxdev = 4;
- if (sixpack_maxdev * sizeof(void*) >= KMALLOC_MAXSIZE) {
- printk(msg_invparm);
- return -ENFILE;
- }
printk(msg_banner, sixpack_maxdev);
@@ -797,8 +793,6 @@
memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN); /* Only activated in AX.25 mode */
memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN); /* "" "" "" "" */
-
- dev_init_buffers(dev);
/* New-style flags. */
dev->flags = 0;
Index: baycom_epp.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_epp.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- baycom_epp.c 14 Jan 2001 17:39:25 -0000 1.1.1.1
+++ baycom_epp.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -246,11 +246,6 @@
/* --------------------------------------------------------------------- */
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
-
#define KISS_VERBOSE
/* --------------------------------------------------------------------- */
@@ -615,7 +610,7 @@
while (cnt > 0) {
switch (bc->hdlctx.state) {
case tx_keyup:
- i = min(cnt, bc->hdlctx.flags);
+ i = min_t(int, cnt, bc->hdlctx.flags);
cnt -= i;
bc->hdlctx.flags -= i;
if (bc->hdlctx.flags <= 0)
@@ -638,7 +633,7 @@
break;
}
}
- i = min(cnt, bc->hdlctx.bufcnt);
+ i = min_t(int, cnt, bc->hdlctx.bufcnt);
bc->hdlctx.bufcnt -= i;
cnt -= i;
if (i != pp->ops->epp_write_data(pp, bc->hdlctx.bufptr, i, 0))
@@ -652,7 +647,7 @@
bc->hdlctx.state = tx_data;
break;
}
- i = min(cnt, bc->hdlctx.flags);
+ i = min_t(int, cnt, bc->hdlctx.flags);
if (i) {
cnt -= i;
bc->hdlctx.flags -= i;
@@ -669,7 +664,7 @@
default: /* fall through */
if (bc->hdlctx.calibrate <= 0)
return 0;
- i = min(cnt, bc->hdlctx.calibrate);
+ i = min_t(int, cnt, bc->hdlctx.calibrate);
cnt -= i;
bc->hdlctx.calibrate -= i;
memset(tmp, 0, sizeof(tmp));
@@ -1379,8 +1374,6 @@
dev->get_stats = baycom_get_stats;
/* Fill in the fields of the device structure */
- dev_init_buffers(dev);
-
bc->skb = NULL;
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
Index: baycom_par.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_par.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- baycom_par.c 14 Jan 2001 17:38:46 -0000 1.1.1.1
+++ baycom_par.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -157,11 +157,6 @@
/* --------------------------------------------------------------------- */
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
-
static void __inline__ baycom_int_freq(struct baycom_state *bc)
{
#ifdef BAYCOM_DEBUG
@@ -569,7 +564,7 @@
static int __init baycom_par_setup(char *str)
{
- static unsigned nr_dev = 0;
+ static unsigned nr_dev;
int ints[2];
if (nr_dev >= NR_PORTS)
Index: baycom_ser_fdx.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_ser_fdx.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- baycom_ser_fdx.c 14 Jan 2001 17:38:49 -0000 1.1.1.1
+++ baycom_ser_fdx.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -152,11 +152,6 @@
/* --------------------------------------------------------------------- */
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
-
static void inline baycom_int_freq(struct baycom_state *bc)
{
#ifdef BAYCOM_DEBUG
@@ -689,7 +684,7 @@
static int __init baycom_ser_fdx_setup(char *str)
{
- static unsigned nr_dev = 0;
+ static unsigned nr_dev;
int ints[4];
if (nr_dev >= NR_PORTS)
Index: baycom_ser_hdx.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/baycom_ser_hdx.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- baycom_ser_hdx.c 14 Jan 2001 17:38:52 -0000 1.1.1.1
+++ baycom_ser_hdx.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -143,11 +143,6 @@
/* --------------------------------------------------------------------- */
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
-
static void inline baycom_int_freq(struct baycom_state *bc)
{
#ifdef BAYCOM_DEBUG
@@ -729,7 +724,7 @@
static int __init baycom_ser_hdx_setup(char *str)
{
- static unsigned nr_dev = 0;
+ static unsigned nr_dev;
int ints[3];
if (nr_dev >= NR_PORTS)
Index: bpqether.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/bpqether.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- bpqether.c 14 Jan 2001 17:38:54 -0000 1.1.1.1
+++ bpqether.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -87,7 +87,7 @@
#include <linux/bpqether.h>
-static const char banner[] __initdata = KERN_INFO "AX.25: bpqether driver version 004\n";
+static char banner[] __initdata = KERN_INFO "AX.25: bpqether driver version 004\n";
static unsigned char ax25_bcast[AX25_ADDR_LEN] =
{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1};
@@ -166,7 +166,7 @@
*/
static int bpq_check_devices(struct net_device *dev)
{
- struct bpqdev *bpq, *bpq_prev;
+ struct bpqdev *bpq, *bpq_prev, *bpq_next;
int result = 0;
unsigned long flags;
@@ -175,7 +175,8 @@
bpq_prev = NULL;
- for (bpq = bpq_devices; bpq != NULL; bpq = bpq->next) {
+ for (bpq = bpq_devices; bpq != NULL; bpq = bpq_next) {
+ bpq_next = bpq->next;
if (!dev_get(bpq->ethname)) {
if (bpq_prev)
bpq_prev->next = bpq->next;
@@ -192,8 +193,8 @@
unregister_netdevice(&bpq->axdev);
kfree(bpq);
}
-
- bpq_prev = bpq;
+ else
+ bpq_prev = bpq;
}
restore_flags(flags);
@@ -529,8 +530,6 @@
kfree(bpq);
return -EIO;
}
-
- dev_init_buffers(dev);
dev->hard_start_xmit = bpq_xmit;
dev->open = bpq_open;
Index: dmascc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/dmascc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- dmascc.c 14 Jan 2001 17:39:19 -0000 1.1.1.1
+++ dmascc.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -294,7 +294,7 @@
/* Global variables */
-static struct scc_info *first = NULL;
+static struct scc_info *first;
static unsigned long rand;
@@ -593,7 +593,6 @@
dev->tx_queue_len = 64;
memcpy(dev->broadcast, ax25_broadcast, 7);
memcpy(dev->dev_addr, ax25_test, 7);
- dev_init_buffers(dev);
rtnl_lock();
if (register_netdevice(dev)) {
printk("dmascc: could not register %s\n", dev->name);
Index: hdlcdrv.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/hdlcdrv.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- hdlcdrv.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ hdlcdrv.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -95,11 +95,6 @@
#define PARAM_RETURN 255
/* --------------------------------------------------------------------- */
-
-#define min(a, b) (((a) < (b)) ? (a) : (b))
-#define max(a, b) (((a) > (b)) ? (a) : (b))
-
-/* --------------------------------------------------------------------- */
/*
* the CRC routines are stolen from WAMPES
* by Dieter Deyke
@@ -791,7 +786,6 @@
dev->get_stats = hdlcdrv_get_stats;
/* Fill in the fields of the device structure */
- dev_init_buffers(dev);
s->skb = NULL;
Index: mkiss.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/mkiss.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- mkiss.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ mkiss.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -54,7 +54,7 @@
#include <linux/tcp.h>
#endif
-static const char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n";
+static char banner[] __initdata = KERN_INFO "mkiss: AX.25 Multikiss, Hans Albas PE1AYX\n";
#define NR_MKISS 4
#define MKISS_SERIAL_TYPE_NORMAL 1
@@ -934,8 +934,6 @@
memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN);
memcpy(dev->dev_addr, ax25_test, AX25_ADDR_LEN);
-
- dev_init_buffers(dev);
/* New-style flags. */
dev->flags = 0;
Index: scc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/scc.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- scc.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ scc.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -184,7 +184,7 @@
#include <linux/kernel.h>
#include <linux/proc_fs.h>
-static const char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver version "VERSION".dl1bke\n";
+static char banner[] __initdata = KERN_INFO "AX.25: Z8530 SCC driver version "VERSION".dl1bke\n";
static void t_dwait(unsigned long);
static void t_txdelay(unsigned long);
@@ -214,9 +214,9 @@
static int scc_net_set_mac_address(struct net_device *dev, void *addr);
static struct net_device_stats * scc_net_get_stats(struct net_device *dev);
-static unsigned char *SCC_DriverName = "scc";
+static unsigned char SCC_DriverName[] = "scc";
-static struct irqflags { unsigned char used : 1; } Ivec[16];
+static struct irqflags { unsigned char used : 1; } Ivec[NR_IRQS];
static struct scc_channel SCC_Info[2 * SCC_MAXCHIPS]; /* information per channel */
@@ -582,7 +582,7 @@
if (skb != NULL)
dev_kfree_skb_irq(skb);
- scc->rx_buff = NULL;
+ scc->rx_buff = skb = NULL;
}
if(status & END_FR && skb != NULL) /* end of frame */
@@ -689,7 +689,7 @@
break;
}
- /* This looks wierd and it is. At least the BayCom USCC doesn't
+ /* This looks weird and it is. At least the BayCom USCC doesn't
* use the Interrupt Daisy Chain, thus we'll have to start
* all over again to be sure not to miss an interrupt from
* (any of) the other chip(s)...
@@ -1484,7 +1484,7 @@
printk(KERN_INFO "Init Z8530 driver: %u channels, IRQ", Nchips*2);
flag=" ";
- for (k = 0; k < 16; k++)
+ for (k = 0; k < NR_IRQS; k++)
if (Ivec[k].used)
{
printk("%s%d", flag, k);
@@ -1574,8 +1574,6 @@
static int scc_net_init(struct net_device *dev)
{
- dev_init_buffers(dev);
-
dev->tx_queue_len = 16; /* should be enough... */
dev->open = scc_net_open;
@@ -1766,6 +1764,9 @@
if (hwcfg.irq == 2) hwcfg.irq = 9;
+ if (hwcfg.irq <0 || hwcfg.irq > NR_IRQS)
+ return -EINVAL;
+
if (!Ivec[hwcfg.irq].used && hwcfg.irq)
{
if (request_irq(hwcfg.irq, scc_isr, SA_INTERRUPT, "AX.25 SCC", NULL))
@@ -1774,8 +1775,8 @@
Ivec[hwcfg.irq].used = 1;
}
- if (hwcfg.vector_latch) {
- if (!request_region(Vector_Latch, 1, "scc vector latch"))
+ if (hwcfg.vector_latch && !Vector_Latch) {
+ if (!request_region(hwcfg.vector_latch, 1, "scc vector latch"))
printk(KERN_WARNING "z8530drv: warning, cannot reserve vector latch port 0x%lx\n, disabled.", hwcfg.vector_latch);
else
Vector_Latch = hwcfg.vector_latch;
@@ -2164,7 +2165,7 @@
}
}
- for (k=0; k < 16 ; k++)
+ for (k=0; k < NR_IRQS ; k++)
if (Ivec[k].used) free_irq(k, NULL);
if (Vector_Latch)
Index: yam.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/hamradio/yam.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- yam.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ yam.c 11 Apr 2002 12:37:47 -0000 1.2
@@ -35,6 +35,9 @@
* 0.6 F6FBB 25.08.98 Added 1200Bds format
* 0.7 F6FBB 12.09.98 Added to the kernel configuration
* 0.8 F6FBB 14.10.98 Fixed slottime/persistance timing bug
+ * OK1ZIA 2.09.01 Fixed "kfree_skb on hard IRQ"
+ * using dev_kfree_skb_any(). (important in 2.4 kernel)
+ *
*/
/*****************************************************************************/
@@ -81,7 +84,7 @@
/* --------------------------------------------------------------------- */
static const char yam_drvname[] = "yam";
-static const char yam_drvinfo[] __initdata = KERN_INFO "YAM driver version 0.8 by F1OAT/F6FBB\n";
+static char yam_drvinfo[] __initdata = KERN_INFO "YAM driver version 0.8 by F1OAT/F6FBB\n";
/* --------------------------------------------------------------------- */
@@ -649,16 +652,16 @@
yp->tx_state = TX_DATA;
if (skb->data[0] != 0) {
/* do_kiss_params(s, skb->data, skb->len); */
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
break;
}
yp->tx_len = skb->len - 1; /* strip KISS byte */
if (yp->tx_len >= YAM_MAX_FRAME || yp->tx_len < 2) {
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
break;
}
memcpy(yp->tx_buf, skb->data + 1, yp->tx_len);
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
yp->tx_count = 0;
yp->tx_crcl = 0x21;
yp->tx_crch = 0xf3;
@@ -858,7 +861,7 @@
return -EIO;
}
outb(0, IER(dev->base_addr));
- if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, NULL)) {
+ if (request_irq(dev->irq, yam_interrupt, SA_INTERRUPT | SA_SHIRQ, dev->name, dev)) {
printk(KERN_ERR "%s: irq %d busy\n", dev->name, dev->irq);
return -EBUSY;
}
@@ -896,7 +899,7 @@
outb(0, IER(dev->base_addr));
outb(1, MCR(dev->base_addr));
/* Remove IRQ handler if last */
- free_irq(dev->irq, NULL);
+ free_irq(dev->irq,dev);
release_region(dev->base_addr, YAM_EXTENT);
netif_stop_queue(dev);
while ((skb = skb_dequeue(&yp->send_queue)))
@@ -1071,7 +1074,6 @@
dev->hard_start_xmit = yam_send_packet;
dev->get_stats = yam_get_stats;
- dev_init_buffers(dev);
skb_queue_head_init(&yp->send_queue);
#if defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE)
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:37
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/ftape/compressor
Modified Files:
Makefile lzrw3.c lzrw3.h zftape-compress.c zftape-compress.h
Log Message:
synch 2.4.15 commit 55
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: lzrw3.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor/lzrw3.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: lzrw3.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor/lzrw3.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: zftape-compress.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor/zftape-compress.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- zftape-compress.c 14 Jan 2001 17:58:17 -0000 1.1.1.1
+++ zftape-compress.c 11 Apr 2002 13:31:01 -0000 1.2
@@ -1258,14 +1258,13 @@
TRACE_EXIT 0;
}
-
#ifdef MODULE
-#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,18)
+
MODULE_AUTHOR(
"(c) 1996, 1997 Claus-Justus Heine (cl...@mo...");
MODULE_DESCRIPTION(
"Compression routines for zftape. Uses the lzrw3 algorithm by Ross Williams");
-#endif
+MODULE_LICENSE("GPL");
#if LINUX_VERSION_CODE >= KERNEL_VER(2,1,18)
static int can_unload(void)
Index: zftape-compress.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/compressor/zftape-compress.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:37
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/skfp
Modified Files:
drvfbi.c ess.c fplustm.c pcmplc.c skfddi.c srf.c
Log Message:
synch 2.4.15 commit 50
Index: drvfbi.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/drvfbi.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- drvfbi.c 14 Jan 2001 17:40:25 -0000 1.1.1.1
+++ drvfbi.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -849,7 +849,7 @@
#ifdef EISA
-/*arrays with io adresses of dma controller length and adress registers*/
+/*arrays with io addresses of dma controller length and address registers*/
static const int cntr[8] = { 0x001,0x003,0x005,0x007,0,0x0c6,0x0ca,0x0ce } ;
static const int base[8] = { 0x000,0x002,0x004,0x006,0,0x0c4,0x0c8,0x0cc } ;
static const int page[8] = { 0x087,0x083,0x081,0x082,0,0x08b,0x089,0x08a } ;
Index: ess.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/ess.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ess.c 14 Jan 2001 17:40:29 -0000 1.1.1.1
+++ ess.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -258,8 +258,16 @@
* Extract message parameters
*/
p = (void *) sm_to_para(smc,sm,SMT_P320F) ;
+ if (!p) {
+ printk(KERN_ERR "ESS: sm_to_para failed");
+ return fs;
+ }
payload = ((struct smt_p_320f *)p)->mib_payload ;
p = (void *) sm_to_para(smc,sm,SMT_P3210) ;
+ if (!p) {
+ printk(KERN_ERR "ESS: sm_to_para failed");
+ return fs;
+ }
overhead = ((struct smt_p_3210 *)p)->mib_overhead ;
DB_ESSN(2,"payload= %lx overhead= %lx\n",payload,overhead) ;
Index: fplustm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/fplustm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- fplustm.c 14 Jan 2001 17:40:35 -0000 1.1.1.1
+++ fplustm.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -87,7 +87,7 @@
/*
- * usefull interrupt bits
+ * useful interrupt bits
*/
static int mac_imsk1u = FM_STXABRS | FM_STXABRA0 | FM_SXMTABT ;
static int mac_imsk1l = FM_SQLCKS | FM_SQLCKA0 | FM_SPCEPDS | FM_SPCEPDA0|
@@ -1381,7 +1381,7 @@
CHECK_CAM() ;
/*
- * wirte the multicast addres into the CAM
+ * write the multicast address into the CAM
*/
outpw(FM_A(FM_AFCOMP2),
(u_short)((tb->a.a[0]<<8)+tb->a.a[1])) ;
Index: pcmplc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/pcmplc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- pcmplc.c 14 Jan 2001 17:40:51 -0000 1.1.1.1
+++ pcmplc.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -1722,7 +1722,7 @@
}
if (cmd & PL_EBUF_ERR) { /* elastic buff. det. over-|underflow*/
/*
- * Check whether the SRF Condition occured.
+ * Check whether the SRF Condition occurred.
*/
if (!plc->ebuf_cont && phy->mib->fddiPORTPCMState == PC8_ACTIVE){
/*
Index: skfddi.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/skfddi.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- skfddi.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ skfddi.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -182,12 +182,18 @@
extern void enable_tx_irq(struct s_smc *smc, u_short queue);
extern void mac_drv_clear_txd(struct s_smc *smc);
+static struct pci_device_id skfddi_pci_tbl[] __initdata = {
+ { PCI_VENDOR_ID_SK, PCI_DEVICE_ID_SK_FP, PCI_ANY_ID, PCI_ANY_ID, },
+ { } /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, skfddi_pci_tbl);
+MODULE_LICENSE("GPL");
// Define module-wide (static) variables
-static int num_boards = 0; /* total number of adapters configured */
-static int num_fddi = 0;
-static int autoprobed = 0;
+static int num_boards; /* total number of adapters configured */
+static int num_fddi;
+static int autoprobed;
#ifdef MODULE
int init_module(void);
@@ -195,7 +201,7 @@
static struct net_device *unlink_modules(struct net_device *p);
static int loading_module = 1;
#else
-static int loading_module = 0;
+static int loading_module;
#endif // MODULE
#ifdef DRIVERDEBUG
@@ -1632,7 +1638,7 @@
* This function is called by the hardware dependent module.
* It allocates the memory for the RxD and TxD descriptors.
*
- * This memory must be non-cached, non-movable and non-swapable.
+ * This memory must be non-cached, non-movable and non-swappable.
* This memory should start at a physical page boundary.
* Args
* smc - A pointer to the SMT context struct.
@@ -2552,7 +2558,7 @@
*
************************/
#define LP(a) ((struct s_smc*)(a))
-static struct net_device *mdev = NULL;
+static struct net_device *mdev;
/************************
*
Index: srf.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/srf.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- srf.c 14 Jan 2001 17:41:21 -0000 1.1.1.1
+++ srf.c 11 Apr 2002 12:37:50 -0000 1.2
@@ -197,7 +197,7 @@
struct s_srf_evc *evc ;
int cond_asserted = 0 ;
int cond_deasserted = 0 ;
- int event_occured = 0 ;
+ int event_occurred = 0 ;
int tsr ;
int T_Limit = 2*TICKS_PER_SECOND ;
@@ -246,7 +246,7 @@
*evc->evc_multiple = FALSE ;
}
smc->srf.any_report = TRUE ;
- event_occured = TRUE ;
+ event_occurred = TRUE ;
}
#ifdef FDDI_MIB
snmp_srf_event(smc,evc) ;
@@ -268,7 +268,7 @@
break ;
}
/* SR01c */
- if (event_occured && tsr < T_Limit) {
+ if (event_occurred && tsr < T_Limit) {
smc->srf.sr_state = SR1_HOLDOFF ;
break ;
}
@@ -286,7 +286,7 @@
break ;
}
/* SR00d */
- if (event_occured && tsr >= T_Limit) {
+ if (event_occurred && tsr >= T_Limit) {
smc->srf.TSR = smt_get_time() ;
smt_send_srf(smc) ;
break ;
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:33
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/ftape Modified Files: Makefile Log Message: synch 2.4.15 commit 55 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/ftape/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 |
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:32
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char
In directory usw-pr-cvs1:/tmp/cvs-serv8509/sgi/char
Modified Files:
Makefile ds1286.c graphics.c newport.c rrm.c sgicons.c
sgiserial.c sgiserial.h shmiq.c streamable.c usema.c
Removed Files:
graphics_syms.c linux_logo.h
Log Message:
synch 2.4.15 commit 52
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:57:55 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 12:55:55 -0000 1.2
@@ -8,25 +8,12 @@
# Note 2! The CFLAGS definitions are now in the main makefile...
O_TARGET := sgichar.o
-OX_OBJS := newport.o
-O_OBJS := sgicons.o \
- usema.o shmiq.o streamable.o
-ifeq ($(CONFIG_SGI_SERIAL),y)
- O_OBJS += sgiserial.o
-endif
+export-objs := newport.o shmiq.o sgicons.o usema.o
+obj-y := newport.o shmiq.o sgicons.o usema.o streamable.o
-ifeq ($(CONFIG_SGI_DS1286),y)
- O_OBJS += ds1286.o
-endif
-
-ifeq ($(CONFIG_SGI_NEWPORT_GFX),y)
- O_OBJS += graphics.o rrm.o
-else
-ifeq ($(CONFIG_SGI_NEWPORT_GFX),m)
- OX_OBJS += graphics_syms.o
- MX_OBJS += graphics.o rrm.o
-endif
-endif
+obj-$(CONFIG_SGI_SERIAL) += sgiserial.o
+obj-$(CONFIG_SGI_DS1286) += ds1286.o
+obj-$(CONFIG_SGI_NEWPORT_GFX) += graphics.o rrm.o
include $(TOPDIR)/Rules.make
Index: ds1286.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/ds1286.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- ds1286.c 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ ds1286.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,32 +1,30 @@
-/* $Id$
- *
- * Real Time Clock interface for Linux
+/*
+ * DS1286 Real Time Clock interface for Linux
*
- * Copyright (C) 1998, 1999 Ralf Baechle
+ * Copyright (C) 1998, 1999, 2000 Ralf Baechle
*
- * Based on code written by Paul Gortmaker.
+ * Based on code written by Paul Gortmaker.
*
- * This driver allows use of the real time clock (built into
- * nearly all computers) from user space. It exports the /dev/rtc
- * interface supporting various ioctl() and also the /proc/rtc
- * pseudo-file for status information.
+ * This driver allows use of the real time clock (built into nearly all
+ * computers) from user space. It exports the /dev/rtc interface supporting
+ * various ioctl() and also the /proc/rtc pseudo-file for status
+ * information.
*
- * The ioctls can be used to set the interrupt behaviour and
- * generation rate from the RTC via IRQ 8. Then the /dev/rtc
- * interface can be used to make use of these timer interrupts,
- * be they interval or alarm based.
+ * The ioctls can be used to set the interrupt behaviour and generation rate
+ * from the RTC via IRQ 8. Then the /dev/rtc interface can be used to make
+ * use of these timer interrupts, be they interval or alarm based.
*
- * The /dev/rtc interface will block on reads until an interrupt
- * has been received. If a RTC interrupt has already happened,
- * it will output an unsigned long and then block. The output value
- * contains the interrupt status in the low byte and the number of
- * interrupts since the last read in the remaining high bytes. The
- * /dev/rtc interface can also be used with the select(2) call.
+ * The /dev/rtc interface will block on reads until an interrupt has been
+ * received. If a RTC interrupt has already happened, it will output an
+ * unsigned long and then block. The output value contains the interrupt
+ * status in the low byte and the number of interrupts since the last read
+ * in the remaining high bytes. The /dev/rtc interface can also be used with
+ * the select(2) call.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License as published by the
+ * Free Software Foundation; either version 2 of the License, or (at your
+ * option) any later version.
*/
#include <linux/types.h>
#include <linux/errno.h>
@@ -38,7 +36,6 @@
#include <linux/poll.h>
#include <linux/rtc.h>
#include <linux/spinlock.h>
-#include <linux/smp_lock.h>
#include <asm/ds1286.h>
#include <asm/io.h>
@@ -56,8 +53,6 @@
static DECLARE_WAIT_QUEUE_HEAD(ds1286_wait);
-static long long ds1286_llseek(struct file *file, loff_t offset, int origin);
-
static ssize_t ds1286_read(struct file *file, char *buf,
size_t count, loff_t *ppos);
@@ -83,63 +78,20 @@
#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */
#define RTC_TIMER_ON 0x02 /* missed irq timer active */
-unsigned char ds1286_status = 0; /* bitmapped status byte. */
-unsigned long ds1286_freq = 0; /* Current periodic IRQ rate */
-unsigned long ds1286_irq_data = 0; /* our output to the world */
+unsigned char ds1286_status; /* bitmapped status byte. */
+unsigned long ds1286_freq; /* Current periodic IRQ rate */
unsigned char days_in_mo[] =
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
/*
- * A very tiny interrupt handler. It runs with SA_INTERRUPT set,
- * so that there is no possibility of conflicting with the
- * set_rtc_mmss() call that happens during some timer interrupts.
- * (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
- */
-
-/*
* Now all the various file operations that we export.
*/
-static long long ds1286_llseek(struct file *file, loff_t offset, int origin)
-{
- return -ESPIPE;
-}
-
static ssize_t ds1286_read(struct file *file, char *buf,
size_t count, loff_t *ppos)
{
- DECLARE_WAITQUEUE(wait, current);
- unsigned long data;
- ssize_t retval;
-
- if (count < sizeof(unsigned long))
- return -EINVAL;
-
- add_wait_queue(&ds1286_wait, &wait);
-
- current->state = TASK_INTERRUPTIBLE;
-
- while ((data = xchg(&ds1286_irq_data, 0)) == 0) {
- if (file->f_flags & O_NONBLOCK) {
- retval = -EAGAIN;
- goto out;
- }
- if (signal_pending(current)) {
- retval = -ERESTARTSYS;
- goto out;
- }
- schedule();
- }
-
- retval = put_user(data, (unsigned long *)buf);
- if (!retval)
- retval = sizeof(unsigned long);
- out:
- current->state = TASK_RUNNING;
- remove_wait_queue(&ds1286_wait, &wait);
-
- return retval;
+ return -EIO;
}
static int ds1286_ioctl(struct inode *inode, struct file *file,
@@ -345,27 +297,32 @@
static int ds1286_open(struct inode *inode, struct file *file)
{
- if(ds1286_status & RTC_IS_OPEN)
- return -EBUSY;
+ spin_lock_irq(&ds1286_lock);
+
+ if (ds1286_status & RTC_IS_OPEN)
+ goto out_busy;
ds1286_status |= RTC_IS_OPEN;
- ds1286_irq_data = 0;
+
+ spin_lock_irq(&ds1286_lock);
return 0;
+
+out_busy:
+ spin_lock_irq(&ds1286_lock);
+ return -EBUSY;
}
static int ds1286_release(struct inode *inode, struct file *file)
{
- lock_kernel();
ds1286_status &= ~RTC_IS_OPEN;
- unlock_kernel();
+
return 0;
}
static unsigned int ds1286_poll(struct file *file, poll_table *wait)
{
poll_wait(file, &ds1286_wait, wait);
- if (ds1286_irq_data != 0)
- return POLLIN | POLLRDNORM;
+
return 0;
}
@@ -374,7 +331,7 @@
*/
static struct file_operations ds1286_fops = {
- llseek: ds1286_llseek,
+ llseek: no_llseek,
read: ds1286_read,
poll: ds1286_poll,
ioctl: ds1286_ioctl,
@@ -414,7 +371,7 @@
get_rtc_time(&tm);
hundredth = CMOS_READ(RTC_HUNDREDTH_SECOND);
- hundredth = BCD_TO_BIN(hundredth);
+ BCD_TO_BIN(hundredth);
p += sprintf(p,
"rtc_time\t: %02d:%02d:%02d.%02d\n"
Index: graphics.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/graphics.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- graphics.c 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ graphics.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* gfx.c: support for SGI's /dev/graphics, /dev/opengl
*
* Author: Miguel de Icaza (mi...@nu...)
@@ -153,11 +152,11 @@
* sgi_graphics_mmap
*/
disable_gconsole ();
- down(¤t->mm->mmap_sem);
+ down_write(¤t->mm->mmap_sem);
r = do_mmap (file, (unsigned long)vaddr,
cards[board].g_regs_size, PROT_READ|PROT_WRITE,
MAP_FIXED|MAP_PRIVATE, 0);
- up(¤t->mm->mmap_sem);
+ up_write(¤t->mm->mmap_sem);
if (r)
return r;
}
@@ -214,8 +213,7 @@
/*
* This is the core of the direct rendering engine.
*/
-
-unsigned long
+struct page *
sgi_graphics_nopage (struct vm_area_struct *vma, unsigned long address, int
no_share)
{
@@ -250,7 +248,6 @@
pgd = pgd_offset(current->mm, address);
pmd = pmd_offset(pgd, address);
pte = pte_offset(pmd, address);
- printk("page: %08lx\n", pte_page(*pte));
return pte_page(*pte);
}
@@ -346,6 +343,8 @@
}
#ifdef MODULE
+MODULE_LICENSE("GPL");
+
int init_module(void) {
static int initiated = 0;
Index: newport.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/newport.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- newport.c 14 Jan 2001 18:58:13 -0000 1.1.1.1
+++ newport.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -16,6 +16,8 @@
struct newport_regs *npregs;
+EXPORT_SYMBOL(npregs);
+
/* Kernel routines for supporting graphics context switching */
void newport_save (void *y)
Index: rrm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/rrm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rrm.c 14 Jan 2001 18:58:06 -0000 1.1.1.1
+++ rrm.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -9,12 +9,11 @@
*
* Fixes:
*/
+#include <linux/module.h>
+
#include <asm/uaccess.h>
#include <asm/rrm.h>
-#ifdef MODULE
-#include <linux/module.h>
-#endif
int
rrm_open_rn (int rnid, void *arg)
@@ -71,3 +70,6 @@
/* This routine is invoked when the device is closed */
return 0;
}
+
+EXPORT_SYMBOL(rrm_command);
+EXPORT_SYMBOL(rrm_close);
Index: sgicons.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/sgicons.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sgicons.c 14 Jan 2001 18:58:13 -0000 1.1.1.1
+++ sgicons.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* sgicons.c: Setting up and registering console I/O on the SGI.
*
* Copyright (C) 1996 David S. Miller (dm...@en...)
@@ -10,12 +9,10 @@
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/errno.h>
+#include <linux/module.h>
#include <asm/uaccess.h>
#include "gconsole.h"
-/* To make psaux code cleaner */
-unsigned char aux_device_present = 0xaa;
-
/* This is the system graphics console (the first adapter found) */
struct console_ops *gconsole = 0;
struct console_ops *real_gconsole = 0;
@@ -35,6 +32,9 @@
gconsole = 0;
}
}
+
+EXPORT_SYMBOL(disable_gconsole);
+EXPORT_SYMBOL(enable_gconsole);
void
register_gconsole (struct console_ops *gc)
Index: sgiserial.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/sgiserial.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sgiserial.c 14 Jan 2001 18:58:05 -0000 1.1.1.1
+++ sgiserial.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -13,6 +13,9 @@
* thorough pass to merge in the rest of the updates.
* Better still, someone really ought to make it a common
* code module for both platforms. ke...@mi...
+ *
+ * 20010616 - Klaus Naumann <sp...@mg...> : Make serial console work with
+ * any speed - not only 9600
*/
#include <linux/config.h> /* for CONFIG_REMOTE_DEBUG */
@@ -58,9 +61,9 @@
static int zilog_irq = SGI_SERIAL_IRQ;
/* Console hooks... */
-static int zs_cons_chanout = 0;
-static int zs_cons_chanin = 0;
-struct sgi_serial *zs_consinfo = 0;
+static int zs_cons_chanout;
+static int zs_cons_chanin;
+struct sgi_serial *zs_consinfo;
static unsigned char kgdb_regs[16] = {
0, 0, 0, /* write 0, 1, 2 */
@@ -97,6 +100,7 @@
DECLARE_TASK_QUEUE(tq_serial);
struct tty_driver serial_driver, callout_driver;
+struct console *sgisercon;
static int serial_refcount;
/* serial subtype definitions */
@@ -144,10 +148,10 @@
dev_t device, const char *routine)
{
#ifdef SERIAL_PARANOIA_CHECK
- static const char *badmagic =
+ static const char *badmagic = KERN_WARNING
"Warning: bad magic number for serial struct (%d, %d) in %s\n";
- static const char *badinfo =
- "Warning: null sun_serial for (%d, %d) in %s\n";
+ static const char *badinfo = KERN_WARNING
+ "Warning: null sgi_serial for (%d, %d) in %s\n";
if (!info) {
printk(badinfo, MAJOR(device), MINOR(device), routine);
@@ -178,7 +182,8 @@
* interrupts are enabled. Therefore we have to check ioc_iocontrol before we
* access it.
*/
-static inline unsigned char read_zsreg(struct sgi_zschannel *channel, unsigned char reg)
+static inline unsigned char read_zsreg(struct sgi_zschannel *channel,
+ unsigned char reg)
{
unsigned char retval;
volatile unsigned char junk;
@@ -192,7 +197,8 @@
return retval;
}
-static inline void write_zsreg(struct sgi_zschannel *channel, unsigned char reg, unsigned char value)
+static inline void write_zsreg(struct sgi_zschannel *channel,
+ unsigned char reg, unsigned char value)
{
volatile unsigned char junk;
@@ -323,7 +329,7 @@
*/
static void batten_down_hatches(void)
{
- prom_imode();
+ ArcEnterInteractiveMode();
#if 0
/* If we are doing kadb, we call the debugger
* else we just drop into the boot monitor.
@@ -682,7 +688,7 @@
save_flags(flags); cli();
#ifdef SERIAL_DEBUG_OPEN
- printk("starting up ttys%d (irq %d)...", info->line, info->irq);
+ printk("starting up ttys%d (irq %d)...\n", info->line, info->irq);
#endif
/*
@@ -1302,6 +1308,59 @@
junk = ioc_icontrol->istat0;
sti();
return put_user(status,value);
+}
+
+static int get_modem_info(struct sgi_serial * info, unsigned int *value)
+{
+ unsigned char status;
+ unsigned int result;
+
+ cli();
+ status = info->zs_channel->control;
+ udelay(2);
+ sti();
+ result = ((info->curregs[5] & RTS) ? TIOCM_RTS : 0)
+ | ((info->curregs[5] & DTR) ? TIOCM_DTR : 0)
+ | ((status & DCD) ? TIOCM_CAR : 0)
+ | ((status & SYNC) ? TIOCM_DSR : 0)
+ | ((status & CTS) ? TIOCM_CTS : 0);
+ if (put_user(result, value))
+ return -EFAULT;
+ return 0;
+}
+
+static int set_modem_info(struct sgi_serial * info, unsigned int cmd,
+ unsigned int *value)
+{
+ unsigned int arg;
+
+ if (get_user(arg, value))
+ return -EFAULT;
+ switch (cmd) {
+ case TIOCMBIS:
+ if (arg & TIOCM_RTS)
+ info->curregs[5] |= RTS;
+ if (arg & TIOCM_DTR)
+ info->curregs[5] |= DTR;
+ break;
+ case TIOCMBIC:
+ if (arg & TIOCM_RTS)
+ info->curregs[5] &= ~RTS;
+ if (arg & TIOCM_DTR)
+ info->curregs[5] &= ~DTR;
+ break;
+ case TIOCMSET:
+ info->curregs[5] = ((info->curregs[5] & ~(RTS | DTR))
+ | ((arg & TIOCM_RTS) ? RTS : 0)
+ | ((arg & TIOCM_DTR) ? DTR : 0));
+ break;
+ default:
+ return -EINVAL;
+ }
+ cli();
+ write_zsreg(info->zs_channel, 5, info->curregs[5]);
+ sti();
+ return 0;
}
/*
@@ -1322,11 +1381,10 @@
static int rs_ioctl(struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg)
{
- int error;
- struct sgi_serial * info = (struct sgi_serial *)tty->driver_data;
+ struct sgi_serial * info = (struct sgi_serial *) tty->driver_data;
int retval;
- if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
+ if (serial_paranoia_check(info, tty->device, "zs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
@@ -1353,45 +1411,36 @@
send_break(info, arg ? arg*(HZ/10) : HZ/4);
return 0;
case TIOCGSOFTCAR:
- error = verify_area(VERIFY_WRITE, (void *) arg,sizeof(long));
- if (error)
- return error;
- put_user(C_CLOCAL(tty) ? 1 : 0,
- (unsigned long *) arg);
+ if (put_user(C_CLOCAL(tty) ? 1 : 0,
+ (unsigned long *) arg))
+ return -EFAULT;
return 0;
case TIOCSSOFTCAR:
- error = get_user(arg, (unsigned long *)arg);
- if (error)
- return error;
+ if (get_user(arg, (unsigned long *) arg))
+ return -EFAULT;
tty->termios->c_cflag =
((tty->termios->c_cflag & ~CLOCAL) |
(arg ? CLOCAL : 0));
return 0;
+ case TIOCMGET:
+ return get_modem_info(info, (unsigned int *) arg);
+ case TIOCMBIS:
+ case TIOCMBIC:
+ case TIOCMSET:
+ return set_modem_info(info, cmd, (unsigned int *) arg);
case TIOCGSERIAL:
- error = verify_area(VERIFY_WRITE, (void *) arg,
- sizeof(struct serial_struct));
- if (error)
- return error;
return get_serial_info(info,
(struct serial_struct *) arg);
case TIOCSSERIAL:
return set_serial_info(info,
(struct serial_struct *) arg);
case TIOCSERGETLSR: /* Get line status register */
- error = verify_area(VERIFY_WRITE, (void *) arg,
- sizeof(unsigned int));
- if (error)
- return error;
- else
- return get_lsr_info(info, (unsigned int *) arg);
+ return get_lsr_info(info, (unsigned int *) arg);
case TIOCSERGSTRUCT:
- error = verify_area(VERIFY_WRITE, (void *) arg,
- sizeof(struct sgi_serial));
- if (error)
- return error;
- copy_to_user((struct sun_serial *) arg,
- info, sizeof(struct sgi_serial));
+ if (copy_to_user((struct sgi_serial *) arg,
+ info, sizeof(struct sgi_serial)))
+ return -EFAULT;
return 0;
default:
@@ -1727,11 +1776,19 @@
change_speed(info);
}
+ /* If this is the serial console change the speed to
+ * the right value
+ */
+ if (info->is_cons) {
+ info->tty->termios->c_cflag = sgisercon->cflag;
+ change_speed(info);
+ }
+
info->session = current->session;
info->pgrp = current->pgrp;
#ifdef SERIAL_DEBUG_OPEN
- printk("rs_open ttys%d successful...", info->line);
+ printk("rs_open ttys%d successful...\n", info->line);
#endif
return 0;
}
@@ -1748,13 +1805,10 @@
{
extern struct hpc3_miscregs *hpc3mregs;
- if(chip > 0) {
- prom_printf("Wheee, bogus zs chip number requested.\n");
- prom_getchar();
- romvec->imode();
- }
- return (struct sgi_zslayout *) (&hpc3mregs->ser1cmd);
+ if (chip > 0)
+ panic("Wheee, bogus zs chip number requested.");
+ return (struct sgi_zslayout *) (&hpc3mregs->ser1cmd);
}
@@ -1784,13 +1838,6 @@
}
if(o && i)
io = 1;
- if(ss->zs_baud != 9562) { /* Don't ask... */
- prom_printf("BAD console baud rate %d\n", ss->zs_baud);
- prom_getchar();
- prom_imode();
- panic("Console baud rate weirdness");
- }
-
/* Set flag variable for this port so that it cannot be
* opened for other uses by accident.
@@ -1798,7 +1845,7 @@
ss->is_cons = 1;
if(io) {
- if(!msg_printed) {
+ if (!msg_printed) {
printk("zs%d: console I/O\n", ((channel>>1)&1));
msg_printed = 1;
}
@@ -1806,7 +1853,6 @@
} else {
printk("zs%d: console %s\n", ((channel>>1)&1),
(i==1 ? "input" : (o==1 ? "output" : "WEIRD")));
-
}
}
@@ -2002,7 +2048,6 @@
rs_cons_hook(int chip, int out, int line)
{
int channel;
-
if(chip)
panic("rs_cons_hook called with chip not zero");
@@ -2087,11 +2132,11 @@
static int __init zs_console_setup(struct console *con, char *options)
{
struct sgi_serial *info;
- int baud = 9600;
+ int baud;
int bits = 8;
int parity = 'n';
int cflag = CREAD | HUPCL | CLOCAL;
- char *s;
+ char *s, *dbaud;
int i, brg;
if (options) {
@@ -2102,6 +2147,21 @@
if (*s) parity = *s++;
if (*s) bits = *s - '0';
}
+ else {
+ /* If the user doesn't set console=... try to read the
+ * PROM variable - if this fails use 9600 baud and
+ * inform the user about the problem
+ */
+ dbaud = ArcGetEnvironmentVariable("dbaud");
+ if(dbaud) baud = simple_strtoul(dbaud, NULL, 10);
+ else {
+ /* Use prom_printf() to make sure that the user
+ * is getting anything ...
+ */
+ prom_printf("No dbaud set in PROM ?!? Using 9600.\n");
+ baud = 9600;
+ }
+ }
/*
* Now construct a cflag setting.
@@ -2156,7 +2216,8 @@
info = zs_soft + con->index;
info->is_cons = 1;
- printk("Console: ttyS%d (Zilog8530)\n", info->line);
+ printk("Console: ttyS%d (Zilog8530), %d baud\n",
+ info->line, baud);
i = con->cflag & CBAUD;
if (con->cflag & CBAUDEX) {
@@ -2195,6 +2256,8 @@
zscons_regs[4] |= SB2;
else
zscons_regs[4] |= SB1;
+
+ sgisercon = con;
brg = BPS_TO_BRG(baud, ZS_CLOCK / info->clk_divisor);
zscons_regs[12] = brg & 0xff;
Index: sgiserial.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/sgiserial.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- sgiserial.h 14 Jan 2001 18:58:15 -0000 1.1.1.1
+++ sgiserial.h 11 Apr 2002 12:55:55 -0000 1.2
@@ -359,7 +359,7 @@
#define ZCOUNT 0x2 /* Zero count */
#define Tx_BUF_EMP 0x4 /* Tx Buffer empty */
#define DCD 0x8 /* DCD */
-#define SYNC_HUNT 0x10 /* Sync/hunt */
+#define SYNC 0x10 /* Sync/hunt */
#define CTS 0x20 /* CTS */
#define TxEOM 0x40 /* Tx underrun */
#define BRK_ABRT 0x80 /* Break/Abort */
Index: shmiq.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/shmiq.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- shmiq.c 14 Jan 2001 18:58:17 -0000 1.1.1.1
+++ shmiq.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,5 +1,4 @@
-/* $Id$
- *
+/*
* shmiq.c: shared memory input queue driver
* written 1997 Miguel de Icaza (mi...@nu...)
*
@@ -42,7 +41,6 @@
* Until then, I just allow for 1 qcntl device.
*
*/
-
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/sched.h>
@@ -52,6 +50,7 @@
#include <linux/vmalloc.h>
#include <linux/wait.h>
#include <linux/major.h>
+#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h>
@@ -286,11 +285,11 @@
s = req.arg * sizeof (struct shmqevent) +
sizeof (struct sharedMemoryInputQueue);
v = sys_munmap (vaddr, s);
- down(¤t->mm->mmap_sem);
+ down_write(¤t->mm->mmap_sem);
do_munmap(current->mm, vaddr, s);
do_mmap(filp, vaddr, s, PROT_READ | PROT_WRITE,
MAP_PRIVATE|MAP_FIXED, 0);
- up(¤t->mm->mmap_sem);
+ up_write(¤t->mm->mmap_sem);
shmiqs[minor].events = req.arg;
shmiqs[minor].mapped = 1;
@@ -470,3 +469,5 @@
S_IFCHR | S_IRUSR | S_IWUSR,
&shmiq_fops, NULL);
}
+
+EXPORT_SYMBOL(shmiq_init);
Index: streamable.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/streamable.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: usema.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/char/usema.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- usema.c 14 Jan 2001 18:58:19 -0000 1.1.1.1
+++ usema.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -20,8 +20,7 @@
* usema(7m), usinit(3p), usnewsema(3p)
* /usr/include/sys/usioctl.h
*
-*/
-
+ */
#include <linux/fs.h>
#include <linux/miscdevice.h>
#include <linux/sched.h>
@@ -31,6 +30,7 @@
#include <linux/string.h>
#include <linux/dcache.h>
#include <linux/mm.h>
+#include <linux/module.h>
#include <linux/slab.h>
#include <linux/smp_lock.h>
#include "usema.h"
@@ -180,3 +180,5 @@
SGI_USEMACLONE);
misc_register(&dev_usemaclone);
}
+
+EXPORT_SYMBOL(usema_init);
--- graphics_syms.c DELETED ---
--- linux_logo.h DELETED ---
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:32
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/tokenring
Modified Files:
Config.in abyss.c ibmtr.c lanstreamer.c lanstreamer.h
madgemc.c olympic.c olympic.h smctr.c smctr.h smctr_firmware.h
tms380tr.c tms380tr.h tmsisa.c tmspci.c
Removed Files:
ibmtr.h
Log Message:
synch 2.4.15 commit 50
Index: Config.in
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/Config.in,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- Config.in 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ Config.in 11 Apr 2002 12:37:51 -0000 1.2
@@ -5,21 +5,29 @@
mainmenu_option next_comment
comment 'Token Ring devices'
-bool 'Token Ring driver support' CONFIG_TR
+# So far, we only have PCI, ISA, and MCA token ring devices
+if [ "$CONFIG_PCI" = "y" -o "$CONFIG_ISA" = "y" -o "$CONFIG_MCA" = "y" ]; then
+ bool 'Token Ring driver support' CONFIG_TR
+else
+ define_bool CONFIG_TR n
+fi
+
if [ "$CONFIG_TR" != "n" ]; then
- dep_tristate ' IBM Tropic chipset based adapter support' CONFIG_IBMTR $CONFIG_TR
- dep_tristate ' IBM Olympic chipset PCI adapter support' CONFIG_IBMOL $CONFIG_TR
- dep_tristate ' IBM Lanstreamer chipset PCI adapter support' CONFIG_IBMLS $CONFIG_TR
- dep_tristate ' Generic TMS380 Token Ring ISA/PCI adapter support' CONFIG_TMS380TR $CONFIG_TR
+ if [ "$CONFIG_ISA" = "y" -o "$CONFIG_MCA" = "y" ]; then
+ tristate ' IBM Tropic chipset based adapter support' CONFIG_IBMTR
+ fi
+ dep_tristate ' IBM Olympic chipset PCI adapter support' CONFIG_IBMOL $CONFIG_TR $CONFIG_PCI
+ dep_tristate ' IBM Lanstreamer chipset PCI adapter support' CONFIG_IBMLS $CONFIG_TR $CONFIG_PCI
+ tristate ' Generic TMS380 Token Ring ISA/PCI adapter support' CONFIG_TMS380TR
if [ "$CONFIG_TMS380TR" != "n" ]; then
- dep_tristate ' Generic TMS380 PCI support' CONFIG_TMSPCI $CONFIG_TMS380TR
- dep_tristate ' Generic TMS380 ISA support' CONFIG_TMSISA $CONFIG_TMS380TR
- dep_tristate ' Madge Smart 16/4 PCI Mk2 support' CONFIG_ABYSS $CONFIG_TMS380TR
- if [ "$CONFIG_MCA" = "y" ]; then
- dep_tristate ' Madge Smart 16/4 Ringnode MicroChannel' CONFIG_MADGEMC $CONFIG_TMS380TR
- fi
+ dep_tristate ' Generic TMS380 PCI support' CONFIG_TMSPCI $CONFIG_PCI
+ dep_tristate ' Generic TMS380 ISA support' CONFIG_TMSISA $CONFIG_ISA
+ dep_tristate ' Madge Smart 16/4 PCI Mk2 support' CONFIG_ABYSS $CONFIG_PCI
+ dep_tristate ' Madge Smart 16/4 Ringnode MicroChannel' CONFIG_MADGEMC $CONFIG_MCA
+ fi
+ if [ "$CONFIG_ISA" = "y" -o "$CONFIG_MCA" = "y" ]; then
+ tristate ' SMC ISA/MCA adapter support' CONFIG_SMCTR
fi
- dep_tristate ' SMC ISA/MCA adapter support' CONFIG_SMCTR $CONFIG_TR
fi
endmenu
Index: abyss.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/abyss.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- abyss.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ abyss.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -53,6 +53,8 @@
};
MODULE_DEVICE_TABLE(pci, abyss_pci_tbl);
+MODULE_LICENSE("GPL");
+
static int abyss_open(struct net_device *dev);
static int abyss_close(struct net_device *dev);
static void abyss_enable(struct net_device *dev);
@@ -137,8 +139,7 @@
*/
dev->base_addr += 0x10;
- ret = tmsdev_init(dev,0,pdev);
- /* XXX: should be the max PCI32 DMA max */
+ ret = tmsdev_init(dev, PCI_MAX_ADDRESS, pdev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n",
dev->name);
Index: ibmtr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/ibmtr.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- ibmtr.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ ibmtr.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -7,10 +7,11 @@
* This device driver should work with Any IBM Token Ring Card that does
* not use DMA.
*
- * I used Donald Becker's (be...@ce...) device driver work
+ * I used Donald Becker's (be...@sc...) device driver work
* as a base for most of my initial work.
*
- * Changes by Peter De Schrijver (Pet...@li...) :
+ * Changes by Peter De Schrijver
+ * (Pet...@li...) :
*
[...3272 lines suppressed...]
+ outb(0,dev_ibmtr[i]->base_addr+ADAPTRESETREL);
}
+ unregister_trdev(dev_ibmtr[i]);
+ free_irq(dev_ibmtr[i]->irq, dev_ibmtr[i]);
+ release_region(dev_ibmtr[i]->base_addr, IBMTR_IO_EXTENT);
+#ifndef PCMCIA
+ {
+ struct tok_info *ti = (struct tok_info *)dev_ibmtr[i]->priv ;
+ iounmap((u32 *)ti->mmio) ;
+ iounmap((u32 *)ti->sram_virt) ;
+ }
+#endif
+ kfree(dev_ibmtr[i]->priv);
+ kfree(dev_ibmtr[i]);
+ dev_ibmtr[i] = NULL;
+ }
}
-#endif /* MODULE */
-#endif
+#endif /* MODULE */
Index: lanstreamer.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/lanstreamer.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- lanstreamer.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ lanstreamer.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -59,12 +59,10 @@
* 03/03/00 - Merged to kernel, indented -kr -i8 -bri0, fixed some missing
* malloc free checks, reviewed code. <al...@re...>
* 03/13/00 - Added spinlocks for smp
+ * 03/08/01 - Added support for module_init() and module_exit()
*
* To Do:
*
- * 1) Test Network Monitor Mode
- * 2) Add auto reset logic on adapter errors
- * 3) Test with varying options
*
* If Problems do Occur
* Most problems can be rectified by either closing and opening the interface
@@ -123,7 +121,14 @@
* Official releases will only have an a.b.c version number format.
*/
-static char *version = "LanStreamer.c v0.3.1 03/13/99 - Mike Sullivan";
+static char version[] = "LanStreamer.c v0.4.0 03/08/01 - Mike Sullivan";
+
+static struct pci_device_id streamer_pci_tbl[] __initdata = {
+ { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, PCI_ANY_ID, PCI_ANY_ID,},
+ {} /* terminating entry */
+};
+MODULE_DEVICE_TABLE(pci,streamer_pci_tbl);
+
static char *open_maj_error[] = {
"No error", "Lobe Media Test", "Physical Insertion",
@@ -170,8 +175,7 @@
MODULE_PARM(message_level,
"1-" __MODULE_STRING(STREAMER_MAX_ADAPTERS) "i");
-static int streamer_scan(struct net_device *dev);
-static int streamer_init(struct net_device *dev);
+static int streamer_reset(struct net_device *dev);
static int streamer_open(struct net_device *dev);
static int streamer_xmit(struct sk_buff *skb, struct net_device *dev);
static int streamer_close(struct net_device *dev);
@@ -186,98 +190,190 @@
static void streamer_asb_bh(struct net_device *dev);
#if STREAMER_NETWORK_MONITOR
#ifdef CONFIG_PROC_FS
+static int streamer_proc_info(char *buffer, char **start, off_t offset,
+ int length, int *eof, void *data);
static int sprintf_info(char *buffer, struct net_device *dev);
+struct streamer_private *dev_streamer=NULL;
#endif
#endif
-int __init streamer_probe(struct net_device *dev)
+static int __devinit streamer_init_one(struct pci_dev *pdev,
+ const struct pci_device_id *ent)
{
- int cards_found;
-
- cards_found = streamer_scan(dev);
- return cards_found ? 0 : -ENODEV;
-}
-
-static int __init streamer_scan(struct net_device *dev)
-{
- struct pci_dev *pci_device = NULL;
+ struct net_device *dev=NULL;
struct streamer_private *streamer_priv;
- int card_no = 0;
- if (pci_present())
- {
- while ((pci_device = pci_find_device(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, pci_device)))
- {
- if (pci_enable_device(pci_device))
- continue;
- pci_set_master(pci_device);
+ __u32 pio_start, pio_end, pio_flags, pio_len;
+ __u32 mmio_start, mmio_end, mmio_flags, mmio_len;
+ int rc=0;
+ static int card_no=-1;
- /* Check to see if io has been allocated, if so, we've already done this card,
- so continue on the card discovery loop */
+#if STREAMER_DEBUG
+ printk("lanstreamer::streamer_init_one, entry pdev %p\n",pdev);
+#endif
- if (check_region(pci_resource_start(pci_device,0), STREAMER_IO_SPACE))
- {
card_no++;
- continue;
- }
-
- streamer_priv = kmalloc(sizeof(struct streamer_private), GFP_KERNEL);
- if(streamer_priv==NULL)
- {
- printk(KERN_ERR "lanstreamer: out of memory.\n");
- break;
- }
- memset(streamer_priv, 0, sizeof(struct streamer_private));
- init_waitqueue_head(&streamer_priv->srb_wait);
- init_waitqueue_head(&streamer_priv->trb_wait);
-#ifndef MODULE
- dev = init_trdev(dev, 0);
- if(dev==NULL)
- {
- kfree(streamer_priv);
+ dev=init_trdev(dev, sizeof(*streamer_priv));
+ if(dev==NULL) {
printk(KERN_ERR "lanstreamer: out of memory.\n");
- break;
+ return -ENOMEM;
}
SET_MODULE_OWNER(dev);
+ streamer_priv=dev->priv;
+
+#if STREAMER_NETWORK_MONITOR
+#ifdef CONFIG_PROC_FS
+ if (!dev_streamer) {
+ create_proc_read_entry("net/streamer_tr",0,0,streamer_proc_info,NULL);
+ }
+ streamer_priv->next=dev_streamer;
+ dev_streamer=streamer_priv;
#endif
- dev->priv = (void *) streamer_priv;
-#if STREAMER_DEBUG
- printk("pci_device: %p, dev:%p, dev->priv: %p\n",
- pci_device, dev, dev->priv);
#endif
- dev->irq = pci_device->irq;
- dev->base_addr = pci_resource_start(pci_device, 0);
- dev->init = &streamer_init;
- streamer_priv->streamer_card_name = (char *)pci_device->resource[0].name;
- streamer_priv->streamer_mmio =
- ioremap(pci_resource_start(pci_device, 1), 256);
-
- if ((pkt_buf_sz[card_no] < 100) || (pkt_buf_sz[card_no] > 18000))
- streamer_priv->pkt_buf_sz = PKT_BUF_SZ;
- else
- streamer_priv->pkt_buf_sz = pkt_buf_sz[card_no];
-
- streamer_priv->streamer_ring_speed = ringspeed[card_no];
- streamer_priv->streamer_message_level = message_level[card_no];
-
- if (streamer_init(dev) == -1) {
- unregister_netdevice(dev);
- kfree(dev->priv);
- return 0;
+
+ if (pci_enable_device(pdev)) {
+ printk(KERN_ERR "lanstreamer: unable to enable pci device\n");
+ rc=-EIO;
+ goto err_out;
+ }
+
+ pci_set_master(pdev);
+
+ pio_start = pci_resource_start(pdev, 0);
+ pio_end = pci_resource_end(pdev, 0);
+ pio_flags = pci_resource_flags(pdev, 0);
+ pio_len = pci_resource_len(pdev, 0);
+
+ mmio_start = pci_resource_start(pdev, 1);
+ mmio_end = pci_resource_end(pdev, 1);
+ mmio_flags = pci_resource_flags(pdev, 1);
+ mmio_len = pci_resource_len(pdev, 1);
+
+#if STREAMER_DEBUG
+ printk("lanstreamer: pio_start %x pio_end %x pio_len %x pio_flags %x\n",
+ pio_start, pio_end, pio_len, pio_flags);
+ printk("lanstreamer: mmio_start %x mmio_end %x mmio_len %x mmio_flags %x\n",
+ mmio_start, mmio_end, mmio_flags, mmio_len);
+#endif
+
+ if (!request_region(pio_start, pio_len, "lanstreamer")) {
+ printk(KERN_ERR "lanstreamer: unable to get pci io addr %x\n",pio_start);
+ rc= -EBUSY;
+ goto err_out;
+ }
+
+ if (!request_mem_region(mmio_start, mmio_len, "lanstreamer")) {
+ printk(KERN_ERR "lanstreamer: unable to get pci mmio addr %x\n",mmio_start);
+ rc= -EBUSY;
+ goto err_out_free_pio;
+ }
+
+ streamer_priv->streamer_mmio=ioremap(mmio_start, mmio_len);
+ if (streamer_priv->streamer_mmio == NULL) {
+ printk(KERN_ERR "lanstreamer: unable to remap MMIO %x\n",mmio_start);
+ rc= -EIO;
+ goto err_out_free_mmio;
}
+ init_waitqueue_head(&streamer_priv->srb_wait);
+ init_waitqueue_head(&streamer_priv->trb_wait);
+
dev->open = &streamer_open;
dev->hard_start_xmit = &streamer_xmit;
dev->change_mtu = &streamer_change_mtu;
-
dev->stop = &streamer_close;
dev->do_ioctl = NULL;
dev->set_multicast_list = &streamer_set_rx_mode;
dev->get_stats = &streamer_get_stats;
dev->set_mac_address = &streamer_set_mac_address;
- return 1;
+ dev->irq = pdev->irq;
+ dev->base_addr=pio_start;
+
+ streamer_priv->streamer_card_name = (char *)pdev->resource[0].name;
+ streamer_priv->pci_dev=pdev;
+
+ if ((pkt_buf_sz[card_no] < 100) || (pkt_buf_sz[card_no] > 18000))
+ streamer_priv->pkt_buf_sz = PKT_BUF_SZ;
+ else
+ streamer_priv->pkt_buf_sz = pkt_buf_sz[card_no];
+
+ streamer_priv->streamer_ring_speed = ringspeed[card_no];
+ streamer_priv->streamer_message_level = message_level[card_no];
+
+ pci_set_drvdata(pdev, dev);
+
+ spin_lock_init(&streamer_priv->streamer_lock);
+
+ printk("%s \n", version);
+ printk("%s: %s. I/O at %hx, MMIO at %p, using irq %d\n",dev->name,
+ streamer_priv->streamer_card_name,
+ (unsigned int) dev->base_addr,
+ streamer_priv->streamer_mmio,
+ dev->irq);
+
+ if (!streamer_reset(dev)) {
+ return 0;
+ }
+
+ iounmap(streamer_priv->streamer_mmio);
+err_out_free_mmio:
+ release_mem_region(mmio_start, mmio_len);
+err_out_free_pio:
+ release_region(pio_start, pio_len);
+err_out:
+ unregister_trdev(dev);
+ kfree(dev);
+#if STREAMER_DEBUG
+ printk("lanstreamer: Exit error %x\n",rc);
+#endif
+ return rc;
+}
+
+static void __devexit streamer_remove_one(struct pci_dev *pdev) {
+ struct net_device *dev=pci_get_drvdata(pdev);
+ struct streamer_private *streamer_priv;
+
+#if STREAMER_DEBUG
+ printk("lanstreamer::streamer_remove_one entry pdev %p\n",pdev);
+#endif
+
+ if (dev == NULL) {
+ printk(KERN_ERR "lanstreamer::streamer_remove_one, ERROR dev is NULL\n");
+ return;
}
+
+ streamer_priv=dev->priv;
+ if (streamer_priv == NULL) {
+ printk(KERN_ERR "lanstreamer::streamer_remove_one, ERROR dev->priv is NULL\n");
+ return;
}
- return 0;
+
+#if STREAMER_NETWORK_MONITOR
+#ifdef CONFIG_PROC_FS
+ {
+ struct streamer_private *slast;
+ struct streamer_private *scurrent;
+ if (streamer_priv == dev_streamer) {
+ dev_streamer=dev_streamer->next;
+ } else {
+ for(slast=scurrent=dev_streamer; dev_streamer; slast=scurrent, scurrent=scurrent->next) {
+ if (scurrent == streamer_priv) {
+ slast->next=scurrent->next;
+ break;
+ }
+ }
+ }
+ if (!dev_streamer) {
+ remove_proc_entry("net/streamer_tr", NULL);
+ }
+ }
+#endif
+#endif
+
+ unregister_trdev(dev);
+ release_region(pci_resource_start(pdev, 0), pci_resource_len(pdev,0));
+ release_mem_region(pci_resource_start(pdev, 1), pci_resource_len(pdev,1));
+ kfree(dev);
+ pci_set_drvdata(pdev, NULL);
}
@@ -424,32 +520,6 @@
return 0;
}
-static int __init streamer_init(struct net_device *dev)
-{
- struct streamer_private *streamer_priv;
- __u8 *streamer_mmio;
- int rc;
-
- streamer_priv=(struct streamer_private *)dev->priv;
- streamer_mmio=streamer_priv->streamer_mmio;
-
- spin_lock_init(&streamer_priv->streamer_lock);
-
- printk("%s \n", version);
- printk("%s: %s. I/O at %hx, MMIO at %p, using irq %d\n",dev->name,
- streamer_priv->streamer_card_name,
- (unsigned int) dev->base_addr,
- streamer_priv->streamer_mmio,
- dev->irq);
-
- request_region(dev->base_addr, STREAMER_IO_SPACE, "streamer");
-
- rc=streamer_reset(dev);
- return rc;
-}
-
-
-
static int streamer_open(struct net_device *dev)
{
struct streamer_private *streamer_priv = (struct streamer_private *) dev->priv;
@@ -465,7 +535,7 @@
rc=streamer_reset(dev);
}
- if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "streamer", dev)) {
+ if (request_irq(dev->irq, &streamer_interrupt, SA_SHIRQ, "lanstreamer", dev)) {
return -EAGAIN;
}
#if STREAMER_DEBUG
@@ -563,7 +633,7 @@
* timed out.
*/
writew(srb_open + 2, streamer_mmio + LAPA);
- srb_word = ntohs(readw(streamer_mmio + LAPD)) & 0xFF;
+ srb_word = ntohs(readw(streamer_mmio + LAPD)) >> 8;
if (srb_word == STREAMER_CLEAR_RET_CODE) {
printk(KERN_WARNING "%s: Adapter Open time out or error.\n",
dev->name);
@@ -1618,27 +1688,24 @@
static int streamer_proc_info(char *buffer, char **start, off_t offset,
int length, int *eof, void *data)
{
+ struct streamer_private *sdev=NULL;
struct pci_dev *pci_device = NULL;
int len = 0;
off_t begin = 0;
off_t pos = 0;
int size;
- struct device *dev;
-
+ struct net_device *dev;
size = sprintf(buffer, "IBM LanStreamer/MPC Chipset Token Ring Adapters\n");
pos += size;
len += size;
- while ((pci_device = pci_find_device(PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_TR, pci_device)))
- {
+ for(sdev=dev_streamer; sdev; sdev=sdev->next) {
+ pci_device=sdev->pci_dev;
+ dev=pci_get_drvdata(pci_device);
- for (dev = dev_base; dev != NULL; dev = dev->next)
- {
- if (dev->base_addr == pci_device->resource[0].start)
- { /* Yep, a Streamer device */
size = sprintf_info(buffer + len, dev);
len += size;
pos = begin + len;
@@ -1649,9 +1716,7 @@
}
if (pos > offset + length)
break;
- } /* if */
} /* for */
- } /* While */
*start = buffer + (offset - begin); /* Start of wanted data */
len -= (offset - begin); /* Start slop */
@@ -1743,66 +1808,21 @@
#endif
#endif
-#ifdef MODULE
-
-static struct net_device *dev_streamer[STREAMER_MAX_ADAPTERS];
-
-int init_module(void)
-{
- int i;
-
-#if STREAMER_NETWORK_MONITOR
-#ifdef CONFIG_PROC_FS
- create_proc_read_entry("net/streamer_tr",0,0,streamer_proc_info,NULL);
-#endif
-#endif
- for (i = 0; (i < STREAMER_MAX_ADAPTERS); i++)
- {
- dev_streamer[i] = NULL;
- dev_streamer[i] = init_trdev(dev_streamer[i], 0);
- SET_MODULE_OWNER(dev_streamer[i]);
- if (dev_streamer[i] == NULL)
- return -ENOMEM;
-
- dev_streamer[i]->init = &streamer_probe;
-
- if (register_trdev(dev_streamer[i]) != 0) {
- kfree(dev_streamer[i]);
- dev_streamer[i] = NULL;
- if (i == 0)
- {
- printk(KERN_INFO "Streamer: No IBM LanStreamer PCI Token Ring cards found in system.\n");
- return -EIO;
- } else {
- printk(KERN_INFO "Streamer: %d IBM LanStreamer PCI Token Ring card(s) found in system.\n", i);
- return 0;
- }
- }
- }
+static struct pci_driver streamer_pci_driver = {
+ name: "lanstreamer",
+ id_table: streamer_pci_tbl,
+ probe: streamer_init_one,
+ remove: streamer_remove_one,
+};
- return 0;
+static int __init streamer_init_module(void) {
+ return pci_module_init(&streamer_pci_driver);
}
-void cleanup_module(void)
-{
- int i;
- struct streamer_private *streamer_priv;
-
- for (i = 0; i < STREAMER_MAX_ADAPTERS; i++)
- if (dev_streamer[i]) {
- unregister_trdev(dev_streamer[i]);
- release_region(dev_streamer[i]->base_addr, STREAMER_IO_SPACE);
- streamer_priv=(struct streamer_private *)dev_streamer[i]->priv;
- kfree(streamer_priv->streamer_rx_ring);
- kfree(streamer_priv->streamer_tx_ring);
- kfree(dev_streamer[i]->priv);
- kfree(dev_streamer[i]);
- dev_streamer[i] = NULL;
- }
-#if STREAMER_NETWORK_MONITOR
-#ifdef CONFIG_PROC_FS
- remove_proc_entry("net/streamer_tr", NULL);
-#endif
-#endif
+static void __exit streamer_cleanup_module(void) {
+ pci_unregister_driver(&streamer_pci_driver);
}
-#endif /* MODULE */
+
+module_init(streamer_init_module);
+module_exit(streamer_cleanup_module);
+MODULE_LICENSE("GPL");
Index: lanstreamer.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/lanstreamer.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- lanstreamer.h 14 Jan 2001 17:38:43 -0000 1.1.1.1
+++ lanstreamer.h 11 Apr 2002 12:37:51 -0000 1.2
@@ -257,6 +257,8 @@
__u16 arb;
__u16 asb;
+ struct streamer_private *next;
+ struct pci_dev *pci_dev;
__u8 *streamer_mmio;
char *streamer_card_name;
Index: madgemc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/madgemc.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- madgemc.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ madgemc.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -17,7 +17,7 @@
* 16-Jan-00 AF Created
*
*/
-static const char *version = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
+static const char version[] = "madgemc.c: v0.91 23/01/2000 by Adam Fritzler\n";
#include <linux/module.h>
#include <linux/mca.h>
@@ -61,7 +61,7 @@
struct madgemc_card *next;
};
-static struct madgemc_card *madgemc_card_list = NULL;
+static struct madgemc_card *madgemc_card_list;
int madgemc_probe(void);
@@ -155,7 +155,7 @@
int __init madgemc_probe(void)
{
- static int versionprinted = 0;
+ static int versionprinted;
struct net_device *dev;
struct net_local *tp;
struct madgemc_card *card;
@@ -349,6 +349,7 @@
printk(":%2.2x", dev->dev_addr[i]);
printk("\n");
+ /* XXX is ISA_MAX_ADDRESS correct here? */
if (tmsdev_init(dev, ISA_MAX_ADDRESS, NULL)) {
printk("%s: unable to get memory for dev->priv.\n",
dev->name);
@@ -525,7 +526,7 @@
*/
static void madgemc_setregpage(struct net_device *dev, int page)
{
- static int reg1 = 0;
+ static int reg1;
reg1 = inb(dev->base_addr + MC_CONTROL_REG1);
if ((page == 0) && (reg1 & MC_CONTROL_REG1_SRSX)) {
@@ -792,6 +793,8 @@
}
#endif /* MODULE */
+MODULE_LICENSE("GPL");
+
/*
* Local variables:
@@ -803,3 +806,4 @@
* tab-width: 8
* End:
*/
+
Index: olympic.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/olympic.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- olympic.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ olympic.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -1,6 +1,6 @@
/*
* olympic.c (c) 1999 Peter De Schrijver All Rights Reserved
- * 1999 Mike Phillips (ph...@am...)
+ * 1999/2000 Mike Phillips (mi...@li...)
*
* Linux driver for IBM PCI tokenring cards based on the Pit/Pit-Phy/Olympic
* chipset.
@@ -39,9 +39,23 @@
* because they weren't going through read[wl](), there all
* the results had to be in memory in le32 values. kdaaker
*
[...1191 lines suppressed...]
- if (dev_olympic[i]) {
- unregister_trdev(dev_olympic[i]);
- release_region(dev_olympic[i]->base_addr, OLYMPIC_IO_SPACE);
- kfree(dev_olympic[i]->priv);
- kfree(dev_olympic[i]);
- dev_olympic[i] = NULL;
- }
-
-#if OLYMPIC_NETWORK_MONITOR
-#ifdef CONFIG_PROC_FS
- remove_proc_entry("net/olympic_tr", NULL) ;
-#endif
-#endif
-}
-#endif /* MODULE */
+module_init(olympic_pci_init) ;
+module_exit(olympic_pci_cleanup) ;
+
+MODULE_LICENSE("GPL");
Index: olympic.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/olympic.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- olympic.h 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ olympic.h 11 Apr 2002 12:37:51 -0000 1.2
@@ -1,6 +1,6 @@
/*
* olympic.h (c) 1999 Peter De Schrijver All Rights Reserved
- * 1999 Mike Phillips (ph...@am...)
+ * 1999,2000 Mike Phillips (mi...@li...)
*
* Linux driver for IBM PCI tokenring cards based on the olympic and the PIT/PHY chipset.
*
@@ -19,6 +19,7 @@
#define BCTL 0x70
#define BCTL_SOFTRESET (1<<15)
#define BCTL_MIMREB (1<<6)
+#define BCTL_MODE_INDICATOR (1<<5)
#define GPR 0x4a
#define GPR_OPTI_BF (1<<6)
@@ -124,6 +125,9 @@
#define TXSTATQCNT_2 0xe4
#define TXCSA_1 0xc8
#define TXCSA_2 0xe8
+/* Cardbus */
+#define FERMASK 0xf4
+#define FERMASK_INT_BIT (1<<15)
#define OLYMPIC_IO_SPACE 256
@@ -210,43 +214,44 @@
/* xxxx These structures are all little endian in hardware. */
struct olympic_tx_desc {
- __u32 buffer;
- __u32 status_length;
+ u32 buffer;
+ u32 status_length;
};
struct olympic_tx_status {
- __u32 status;
+ u32 status;
};
struct olympic_rx_desc {
- __u32 buffer;
- __u32 res_length;
+ u32 buffer;
+ u32 res_length;
};
struct olympic_rx_status {
- __u32 fragmentcnt_framelen;
- __u32 status_buffercnt;
+ u32 fragmentcnt_framelen;
+ u32 status_buffercnt;
};
/* xxxx END These structures are all little endian in hardware. */
/* xxxx There may be more, but I'm pretty sure about these */
struct mac_receive_buffer {
- __u16 next ;
- __u8 padding ;
- __u8 frame_status ;
- __u16 buffer_length ;
- __u8 frame_data ;
+ u16 next ;
+ u8 padding ;
+ u8 frame_status ;
+ u16 buffer_length ;
+ u8 frame_data ;
};
struct olympic_private {
- __u16 srb; /* be16 */
- __u16 trb; /* be16 */
- __u16 arb; /* be16 */
- __u16 asb; /* be16 */
-
- __u8 *olympic_mmio;
- __u8 *olympic_lap;
+ u16 srb; /* be16 */
+ u16 trb; /* be16 */
+ u16 arb; /* be16 */
+ u16 asb; /* be16 */
+
+ u8 *olympic_mmio;
+ u8 *olympic_lap;
+ struct pci_dev *pdev ;
char *olympic_card_name ;
spinlock_t olympic_lock ;
@@ -259,51 +264,57 @@
volatile int trb_queued; /* True if a TRB is posted */
wait_queue_head_t trb_wait ;
+ /* These must be on a 4 byte boundary. */
struct olympic_rx_desc olympic_rx_ring[OLYMPIC_RX_RING_SIZE];
struct olympic_tx_desc olympic_tx_ring[OLYMPIC_TX_RING_SIZE];
struct olympic_rx_status olympic_rx_status_ring[OLYMPIC_RX_RING_SIZE];
struct olympic_tx_status olympic_tx_status_ring[OLYMPIC_TX_RING_SIZE];
+
struct sk_buff *tx_ring_skb[OLYMPIC_TX_RING_SIZE], *rx_ring_skb[OLYMPIC_RX_RING_SIZE];
int tx_ring_free, tx_ring_last_status, rx_ring_last_received,rx_status_last_received, free_tx_ring_entries;
struct net_device_stats olympic_stats ;
- __u16 olympic_lan_status ;
- __u8 olympic_ring_speed ;
- __u16 pkt_buf_sz ;
- __u8 olympic_receive_options, olympic_copy_all_options, olympic_message_level;
- __u16 olympic_addr_table_addr, olympic_parms_addr ;
- __u8 olympic_laa[6] ;
+ u16 olympic_lan_status ;
+ u8 olympic_ring_speed ;
+ u16 pkt_buf_sz ;
+ u8 olympic_receive_options, olympic_copy_all_options,olympic_message_level, olympic_network_monitor;
+ u16 olympic_addr_table_addr, olympic_parms_addr ;
+ u8 olympic_laa[6] ;
+ u32 rx_ring_dma_addr;
+ u32 rx_status_ring_dma_addr;
+ u32 tx_ring_dma_addr;
+ u32 tx_status_ring_dma_addr;
};
struct olympic_adapter_addr_table {
- __u8 node_addr[6] ;
- __u8 reserved[4] ;
- __u8 func_addr[4] ;
+ u8 node_addr[6] ;
+ u8 reserved[4] ;
+ u8 func_addr[4] ;
} ;
struct olympic_parameters_table {
- __u8 phys_addr[4] ;
- __u8 up_node_addr[6] ;
- __u8 up_phys_addr[4] ;
- __u8 poll_addr[6] ;
- __u16 reserved ;
- __u16 acc_priority ;
- __u16 auth_source_class ;
- __u16 att_code ;
- __u8 source_addr[6] ;
- __u16 beacon_type ;
- __u16 major_vector ;
- __u16 lan_status ;
- __u16 soft_error_time ;
- __u16 reserved1 ;
- __u16 local_ring ;
- __u16 mon_error ;
- __u16 beacon_transmit ;
- __u16 beacon_receive ;
- __u16 frame_correl ;
- __u8 beacon_naun[6] ;
- __u32 reserved2 ;
- __u8 beacon_phys[4] ;
+ u8 phys_addr[4] ;
+ u8 up_node_addr[6] ;
+ u8 up_phys_addr[4] ;
+ u8 poll_addr[6] ;
+ u16 reserved ;
+ u16 acc_priority ;
+ u16 auth_source_class ;
+ u16 att_code ;
+ u8 source_addr[6] ;
+ u16 beacon_type ;
+ u16 major_vector ;
+ u16 lan_status ;
+ u16 soft_error_time ;
+ u16 reserved1 ;
+ u16 local_ring ;
+ u16 mon_error ;
+ u16 beacon_transmit ;
+ u16 beacon_receive ;
+ u16 frame_correl ;
+ u8 beacon_naun[6] ;
+ u32 reserved2 ;
+ u8 beacon_phys[4] ;
};
Index: smctr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/smctr.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- smctr.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ smctr.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -1,7 +1,7 @@
/*
* smctr.c: A network driver for the SMC Token Ring Adapters.
*
- * Written by Jay Schulist <js...@tu...>
+ * Written by Jay Schulist <js...@sa...>
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
@@ -14,7 +14,7 @@
* - SMC TokenCard SDK.
*
* Maintainer(s):
- * JS Jay Schulist <js...@tu...>
+ * JS Jay Schulist <js...@sa...>
*
* Changes:
* 07102000 JS Fixed a timing problem in smctr_wait_cmd();
@@ -59,11 +59,15 @@
#include <linux/skbuff.h>
#include <linux/trdevice.h>
+#if BITS_PER_LONG == 64
+#error FIXME: driver does not support 64-bit platforms
+#endif
+
#include "smctr.h" /* Our Stuff */
#include "smctr_firmware.h" /* SMC adapter firmware */
-static char version[] __initdata = KERN_INFO "smctr.c: v1.4 7/12/00 by js...@tu...\n";
-static const char *cardname = "smctr";
+static char version[] __initdata = KERN_INFO "smctr.c: v1.4 7/12/00 by js...@sa...\n";
+static const char cardname[] = "smctr";
#define SMCTR_IO_EXTENT 20
@@ -82,7 +86,7 @@
static int ringspeed;
/* SMC Name of the Adapter. */
-static char *smctr_name = "SMC TokenCard";
+static char smctr_name[] = "SMC TokenCard";
char *smctr_model = "Unknown";
/* Use 0 for production, 1 for verification, 2 for debug, and
@@ -4383,7 +4387,7 @@
smctr_clear_trc_reset(ioaddr);
mdelay(200); /* ~2 ms */
- /* Remove any latched interrupts that occured prior to reseting the
+ /* Remove any latched interrupts that occurred prior to reseting the
* adapter or possibily caused by line glitches due to the reset.
*/
outb(tp->trc_mask | CSR_CLRTINT | CSR_CLRCBUSY, ioaddr + CSR);
@@ -4546,20 +4550,24 @@
struct sk_buff *skb;
skb = dev_alloc_skb(rx_size);
- skb_put(skb, rx_size);
+ if (skb) {
+ skb_put(skb, rx_size);
- memcpy(skb->data, pbuff, rx_size);
- sti();
+ memcpy(skb->data, pbuff, rx_size);
+ sti();
- /* Update Counters */
- tp->MacStat.rx_packets++;
- tp->MacStat.rx_bytes += skb->len;
-
- /* Kick the packet on up. */
- skb->dev = dev;
- skb->protocol = tr_type_trans(skb, dev);
- netif_rx(skb);
- dev->last_rx = jiffies;
+ /* Update Counters */
+ tp->MacStat.rx_packets++;
+ tp->MacStat.rx_bytes += skb->len;
+
+ /* Kick the packet on up. */
+ skb->dev = dev;
+ skb->protocol = tr_type_trans(skb, dev);
+ netif_rx(skb);
+ dev->last_rx = jiffies;
+ } else {
+ sti();
+ }
}
else
smctr_process_rx_packet((MAC_HEADER *)pbuff,
@@ -5265,7 +5273,7 @@
return (POSITIVE_ACK);
}
-/* Reset the ring speed to the oposite of what it was. This auto-pilot
+/* Reset the ring speed to the opposite of what it was. This auto-pilot
* mode requires a complete reset and re-init of the adapter.
*/
static int smctr_set_ring_speed(struct net_device *dev)
@@ -5724,6 +5732,8 @@
static int io[SMCTR_MAX_ADAPTERS];
static int irq[SMCTR_MAX_ADAPTERS];
static int mem[SMCTR_MAX_ADAPTERS];
+
+MODULE_LICENSE("GPL");
MODULE_PARM(io, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
MODULE_PARM(irq, "1-" __MODULE_STRING(SMCTR_MAX_ADAPTERS) "i");
Index: smctr.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/smctr.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- smctr.h 14 Jan 2001 17:38:21 -0000 1.1.1.1
+++ smctr.h 11 Apr 2002 12:37:51 -0000 1.2
@@ -1,7 +1,7 @@
/* smctr.h: SMC Token Ring driver header for Linux
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*/
#ifndef __LINUX_SMCTR_H
Index: smctr_firmware.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/smctr_firmware.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- smctr_firmware.h 14 Jan 2001 17:38:28 -0000 1.1.1.1
+++ smctr_firmware.h 11 Apr 2002 12:37:51 -0000 1.2
@@ -14,7 +14,7 @@
* - This is an 8K binary image. (MCT.BIN v6.3C1 03/01/95)
*
* Authors:
- * - Jay Schulist <js...@tu...>
+ * - Jay Schulist <js...@sa...>
*/
#include <linux/config.h>
Index: tms380tr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/tms380tr.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- tms380tr.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ tms380tr.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -28,7 +28,7 @@
* - Various Madge employees
*
* Maintainer(s):
- * JS Jay Schulist js...@tu...
+ * JS Jay Schulist js...@sa...
* CG Christoph Goos cg...@sy...
* AF Adam Fritzler mi...@au...
* MLP Mike Phillips ph...@am...
@@ -68,13 +68,11 @@
*/
#ifdef MODULE
-static const char *version = "tms380tr.c: v1.08 14/01/2001 by Christoph Goos, Adam Fritzler\n";
+static const char version[] = "tms380tr.c: v1.08 14/01/2001 by Christoph Goos, Adam Fritzler\n";
#endif
-#ifdef MODULE
#include <linux/module.h>
#include <linux/version.h>
-#endif
#include <linux/kernel.h>
#include <linux/sched.h>
@@ -2192,17 +2190,18 @@
}
}
- if(rpl->SkbStat == SKB_DATA_COPY
- || rpl->SkbStat == SKB_DMA_DIRECT)
+ if(skb && (rpl->SkbStat == SKB_DATA_COPY
+ || rpl->SkbStat == SKB_DMA_DIRECT))
{
if(rpl->SkbStat == SKB_DATA_COPY)
- memmove(skb->data, ReceiveDataPtr, Length);
+ memcpy(skb->data, ReceiveDataPtr, Length);
/* Deliver frame to system */
rpl->Skb = NULL;
skb_trim(skb,Length);
skb->protocol = tr_type_trans(skb,dev);
netif_rx(skb);
+ dev->last_rx = jiffies;
}
}
else /* Invalid frame */
@@ -2415,6 +2414,8 @@
TMS380_module = NULL;
}
#endif
+
+MODULE_LICENSE("GPL");
/*
Index: tms380tr.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/tms380tr.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- tms380tr.h 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ tms380tr.h 11 Apr 2002 12:37:51 -0000 1.2
@@ -395,7 +395,7 @@
/* OPEN Options (high-low) */
#define WRAP_INTERFACE 0x0080 /* Inserting omitted for test
* purposes; transmit data appears
- * as receive data. (usefull for
+ * as receive data. (useful for
* testing; change: CLOSE necessary)
*/
#define DISABLE_HARD_ERROR 0x0040 /* On HARD_ERROR & TRANSMIT_BEACON
@@ -461,7 +461,9 @@
* fragments following.
*/
+/* XXX is there some better way to do this? */
#define ISA_MAX_ADDRESS 0x00ffffff
+#define PCI_MAX_ADDRESS 0xffffffff
#pragma pack(1)
typedef struct {
Index: tmsisa.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/tmsisa.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- tmsisa.c 25 Feb 2001 23:15:00 -0000 1.1.1.1
+++ tmsisa.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -7,7 +7,7 @@
* Dedicated to my girlfriend Steffi Bopp
*
* This software may be used and distributed according to the terms
- * of the GNU Public License, incorporated herein by reference.
+ * of the GNU General Public License, incorporated herein by reference.
*
* This driver module supports the following cards:
* - SysKonnect TR4/16(+) ISA (SK-4190)
@@ -19,7 +19,7 @@
* TODO:
* 1. Add support for Proteon TR ISA adapters (1392, 1392+)
*/
-static const char *version = "tmsisa.c: v1.00 14/01/2001 by Jochen Friedrich\n";
+static const char version[] = "tmsisa.c: v1.00 14/01/2001 by Jochen Friedrich\n";
#include <linux/module.h>
#include <linux/kernel.h>
@@ -60,7 +60,7 @@
0
};
-static char *isa_cardname = "SK NET TR 4/16 ISA\0";
+static char isa_cardname[] = "SK NET TR 4/16 ISA\0";
int tms_isa_probe(struct net_device *dev);
static int tms_isa_open(struct net_device *dev);
@@ -93,7 +93,7 @@
struct tms_isa_card *next;
};
-static struct tms_isa_card *tms_isa_card_list = NULL;
+static struct tms_isa_card *tms_isa_card_list;
static int __init tms_isa_probe1(int ioaddr)
{
@@ -129,7 +129,7 @@
int __init tms_isa_probe(struct net_device *dev)
{
- static int versionprinted = 0;
+ static int versionprinted;
struct net_local *tp;
int j;
struct tms_isa_card *card;
@@ -271,6 +271,14 @@
{
/* Enlist in the card list */
card = kmalloc(sizeof(struct tms_isa_card), GFP_KERNEL);
+ if (!card) {
+ unregister_trdev(dev);
+ release_region(dev->base_addr, TMS_ISA_IO_EXTENT);
+ free_irq(dev->irq, dev);
+ free_dma(dev->dma);
+ tmsdev_term(dev);
+ return -1;
+ }
card->next = tms_isa_card_list;
tms_isa_card_list = card;
card->dev = dev;
@@ -363,6 +371,8 @@
static int io[ISATR_MAX_ADAPTERS];
static int irq[ISATR_MAX_ADAPTERS];
static int dma[ISATR_MAX_ADAPTERS];
+
+MODULE_LICENSE("GPL");
MODULE_PARM(io, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
MODULE_PARM(irq, "1-" __MODULE_STRING(ISATR_MAX_ADAPTERS) "i");
Index: tmspci.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/tokenring/tmspci.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- tmspci.c 25 Feb 2001 23:15:00 -0000 1.1.1.2
+++ tmspci.c 11 Apr 2002 12:37:51 -0000 1.2
@@ -67,6 +67,8 @@
};
MODULE_DEVICE_TABLE(pci, tmspci_pci_tbl);
+MODULE_LICENSE("GPL");
+
static void tms_pci_read_eeprom(struct net_device *dev);
static unsigned short tms_pci_setnselout_pins(struct net_device *dev);
@@ -142,8 +144,7 @@
printk(":%2.2x", dev->dev_addr[i]);
printk("\n");
- ret = tmsdev_init(dev,0, pdev);
- /* XXX: should be the max PCI32 DMA max */
+ ret = tmsdev_init(dev, PCI_MAX_ADDRESS, pdev);
if (ret) {
printk("%s: unable to get memory for dev->priv.\n", dev->name);
goto err_out_irq;
@@ -165,7 +166,7 @@
dev->stop = tms380tr_close;
ret = register_trdev(dev);
- if (!ret)
+ if (ret)
goto err_out_tmsdev;
pci_set_drvdata(pdev, dev);
--- ibmtr.h DELETED ---
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/s390/net
In directory usw-pr-cvs1:/tmp/cvs-serv8509/s390/net
Modified Files:
Makefile ctcmain.c fsm.c fsm.h iucv.c iucv.h netiucv.c
Added Files:
ctctty.c ctctty.h
Removed Files:
ctc.c
Log Message:
synch 2.4.15 commit 52
--- NEW FILE ---
/*
* $Id: ctctty.c,v 1.1 2002/04/11 12:55:55 atp Exp $
*
* CTC / ESCON network driver, tty interface.
*
* Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Fritz Elfert (el...@de..., fe...@mi...)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
[...1300 lines suppressed...]
}
void
ctc_tty_cleanup(int final) {
unsigned long saveflags;
spin_lock_irqsave(&ctc_tty_lock, saveflags);
ctc_tty_shuttingdown = 1;
if (final) {
kfree(driver);
driver = NULL;
} else {
int i;
for (i = 0; i < CTC_TTY_MAX_DEVICES; i++)
driver->info[i].tq.routine = NULL;
tty_unregister_driver(&driver->ctc_tty_device);
}
spin_unlock_irqrestore(&ctc_tty_lock, saveflags);
}
--- NEW FILE ---
/*
* $Id: ctctty.h,v 1.1 2002/04/11 12:55:55 atp Exp $
*
* CTC / ESCON network driver, tty interface.
*
* Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Fritz Elfert (el...@de..., fe...@mi...)
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _CTCTTY_H_
#define _CTCTTY_H_
#include <linux/version.h>
#include <linux/skbuff.h>
#include <linux/netdevice.h>
#if LINUX_VERSION_CODE < 0x020300
typedef struct device net_device;
#else
typedef struct net_device net_device;
#endif
extern int ctc_tty_register_netdev(net_device *);
extern void ctc_tty_unregister_netdev(net_device *);
extern void ctc_tty_netif_rx(struct sk_buff *);
extern int ctc_tty_init(void);
extern void ctc_tty_cleanup(int);
extern void ctc_tty_setcarrier(net_device *, int);
#endif
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/Makefile,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- Makefile 25 Feb 2001 23:15:14 -0000 1.1.1.2
+++ Makefile 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,20 +1,20 @@
-all: s390-net.o
+#
+# S/390 network devices
+#
-CFLAGS +=
O_TARGET := s390-net.o
-obj-y := iucv.o
+list-multi := ctc.o
+export-objs := iucv.o fsm.o
-ifeq ($(CONFIG_CTC),y)
- obj-y += ctcmain.o fsm.o
-else
- ifeq ($(CONFIG_CTC),m)
- obj-m += ctc.o
-ctc.o: ctcmain.o fsm.o
- $(LD) -r ctcmain.o fsm.o -o $@
- endif
-endif
+ctc-objs := ctcmain.o ctctty.o
-obj-$(CONFIG_IUCV) += iucv.o netiucv.o
+obj-y += iucv.o fsm.o
+obj-$(CONFIG_CTC) += ctc.o
+obj-$(CONFIG_IUCV) += netiucv.o
include $(TOPDIR)/Rules.make
+
+ctc.o: $(ctc-objs)
+ $(LD) -r -o $@ $(ctc-objs)
+
Index: ctcmain.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/ctcmain.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- ctcmain.c 25 Feb 2001 23:15:14 -0000 1.1.1.1
+++ ctcmain.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -3,10 +3,10 @@
*
* CTC / ESCON network driver
*
- * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
+ * Copyright (C) 2001 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Fritz Elfert (el...@de..., fe...@mi...)
* Fixes by : Jochen Röhrig (ro...@de...)
- * Arnaldo Carvalho de Melo <ac...@co...>
+ * Arnaldo Carvalho de Melo <ac...@co...>
*
* Documentation used:
[...2322 lines suppressed...]
- return -ENODEV;
+ ret = -ENODEV;
}
- return 0;
+#endif
+ if (ret) {
+ ctc_tty_cleanup(0);
+ ctc_tty_cleanup(1);
+#if defined(CTC_CHANDEV) && defined(MODULE)
+ chandev_unregister(ctc_chandev_probe, 0);
+#endif
+#ifdef MODULE
+ if (probed)
+ ctc_proc_destroy_main();
+#endif
+ }
+ return ret;
}
#ifndef MODULE
Index: fsm.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/fsm.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- fsm.c 25 Feb 2001 23:15:14 -0000 1.1.1.1
+++ fsm.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -3,24 +3,12 @@
*
* A generic FSM based on fsm used in isdn4linux
*
- * $Log$
- * Revision 1.1.1.1 2001/02/25 23:15:14 kenn
- * Import official 2.4.2 Linus tree
- *
- * Revision 1.1 2000/11/30 11:21:08 bird
- * Support for new ctc driver
- *
- * Revision 1.2 2000/11/10 17:25:11 felfert
- * Changes for kernel 2.4
- *
- * Revision 1.1 2000/11/03 16:58:45 felfert
- * Initial import
- *
- *
*/
#include "fsm.h"
#include <linux/version.h>
+#include <linux/config.h>
+#include <linux/module.h>
fsm_instance *
init_fsm(char *name, const char **state_names, const char **event_names, int nr_states,
@@ -231,3 +219,16 @@
this->tl.expires = jiffies + (millisec * HZ) / 1000;
add_timer(&this->tl);
}
+
+EXPORT_SYMBOL(init_fsm);
+EXPORT_SYMBOL(kfree_fsm);
+EXPORT_SYMBOL(fsm_settimer);
+EXPORT_SYMBOL(fsm_deltimer);
+EXPORT_SYMBOL(fsm_addtimer);
+EXPORT_SYMBOL(fsm_modtimer);
+EXPORT_SYMBOL(fsm_getstate_str);
+
+#if FSM_DEBUG_HISTORY
+EXPORT_SYMBOL(fsm_print_history);
+EXPORT_SYMBOL(fsm_record_history);
+#endif
Index: fsm.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/fsm.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- fsm.h 25 Feb 2001 23:15:14 -0000 1.1.1.1
+++ fsm.h 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,16 +1,4 @@
/* $Id$
- *
- * $Log$
- * Revision 1.1.1.1 2001/02/25 23:15:14 kenn
- * Import official 2.4.2 Linus tree
- *
- * Revision 1.1 2000/11/30 11:21:08 bird
- * Support for new ctc driver
- *
- * Revision 1.1 2000/11/03 16:58:45 felfert
- * Initial import
- *
- *
*/
#ifndef _FSM_H_
#define _FSM_H_
@@ -19,7 +7,7 @@
#include <linux/types.h>
#include <linux/timer.h>
#include <linux/time.h>
-#include <linux/malloc.h>
+#include <linux/slab.h>
#include <linux/sched.h>
#include <linux/string.h>
#include <asm/atomic.h>
@@ -118,10 +106,11 @@
* @param tmpl_len Length of the describing array.
* @param order Parameter for allocation of the FSM data structs.
*/
-fsm_instance * init_fsm(char *name, const char **state_names,
- const char **event_names,
- int nr_states, int nr_events, const fsm_node *tmpl,
- int tmpl_len, int order);
+extern fsm_instance *
+init_fsm(char *name, const char **state_names,
+ const char **event_names,
+ int nr_states, int nr_events, const fsm_node *tmpl,
+ int tmpl_len, int order);
/**
* Releases an FSM
Index: iucv.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/iucv.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- iucv.c 25 Feb 2001 23:15:14 -0000 1.1.1.2
+++ iucv.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,2034 +1,2271 @@
/*
- * drivers/s390/net/iucv.c
- * Support for VM IUCV functions for use by other part of the
- * kernel or loadable modules.
- *
- * S390 version
- * Copyright (C) 2000 IBM Corporation
- * Author(s): Xenia Tkatschow (xe...@us...)
- * Alan Altmark (Ala...@us...)
+ * $Id$
+ *
[...4083 lines suppressed...]
EXPORT_SYMBOL (iucv_accept);
EXPORT_SYMBOL (iucv_connect);
EXPORT_SYMBOL (iucv_purge);
-EXPORT_SYMBOL (iucv_query);
+EXPORT_SYMBOL (iucv_query_maxconn);
+EXPORT_SYMBOL (iucv_query_bufsize);
EXPORT_SYMBOL (iucv_quiesce);
EXPORT_SYMBOL (iucv_receive);
-EXPORT_SYMBOL (iucv_receive_simple);
EXPORT_SYMBOL (iucv_receive_array);
EXPORT_SYMBOL (iucv_reject);
EXPORT_SYMBOL (iucv_reply);
@@ -2045,6 +2282,4 @@
EXPORT_SYMBOL (iucv_setmask);
EXPORT_SYMBOL (iucv_sever);
EXPORT_SYMBOL (iucv_register_program);
-EXPORT_SYMBOL (iucv_unregister);
-#endif
-
+EXPORT_SYMBOL (iucv_unregister_program);
Index: iucv.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/iucv.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- iucv.h 25 Feb 2001 23:15:14 -0000 1.1.1.2
+++ iucv.h 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,353 +1,752 @@
/*
- * drivers/s390/net/netiucv.h
+ * drivers/s390/net/iucv.h
* IUCV base support.
*
* S390 version
* Copyright (C) 2000 IBM Corporation
- * Author(s): Xenia Tkatschow (xe...@us...)
+ * Author(s):Alan Altmark (Ala...@us...)
+ * Xenia Tkatschow (xe...@us...)
*
[...971 lines suppressed...]
+ * Input: SetMaskFlag - options for interrupts
+ * 0x80 - Nonpriority_MessagePendingInterruptsFlag
+ * 0x40 - Priority_MessagePendingInterruptsFlag
+ * 0x20 - Nonpriority_MessageCompletionInterruptsFlag
+ * 0x10 - Priority_MessageCompletionInterruptsFlag
+ * Output: NA
+ * Return: Return code from CP IUCV call.
+*/
+int iucv_setmask (int SetMaskFlag);
+
+/*
+ * Name: iucv_sever
+ * Purpose: This function terminates an IUCV path.
+ * Input: pathid - Path identification number.
+ * user_data - 16-bytes of user data.
+ * Output: NA
+ * Return: Return code from CP IUCV call.
+ * (-EINVAL) - Interal error, wild pointer.
+*/
+int iucv_sever (u16 pathid, uchar user_data[16]);
Index: netiucv.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/s390/net/netiucv.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- netiucv.c 25 Feb 2001 23:15:14 -0000 1.1.1.1
+++ netiucv.c 11 Apr 2002 12:55:55 -0000 1.2
@@ -1,901 +1,2122 @@
/*
- * drivers/s390/net/netiucv.c
- * Network driver for VM using iucv
+ * $Id$
*
- * S/390 version
- * Copyright (C) 1999, 2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
- * Author(s): Stefan Hegewald <heg...@de...>
- * Hartmut Penner <hp...@de...>
- *
- *
[...2856 lines suppressed...]
-#endif
- init: iucv_init /* probe function */
- },
- {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
- name: &iucv_names[8][0], /* Name filled in at load time */
-#endif
- init: iucv_init /* probe function */
- },
- {
-#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,0))
- name: &iucv_names[9][0], /* Name filled in at load time */
+#ifdef MODULE
+module_init(netiucv_init);
+module_exit(netiucv_exit);
+MODULE_LICENSE("GPL");
#endif
- init: iucv_init /* probe function */
- },
-};
--- ctc.c DELETED ---
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:30
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/sbus
In directory usw-pr-cvs1:/tmp/cvs-serv8509/sbus
Modified Files:
Makefile sbus.c
Log Message:
synch 2.4.15 commit 52
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:44:36 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 12:55:56 -0000 1.2
@@ -18,6 +18,10 @@
subdir-y += audio
subdir-m += audio
-obj-$(CONFIG_SPARCAUDIO) += audio/sparcaudio.o
+
+# This is grotty but works around some problems with modules.
+ifeq ($(CONFIG_SPARCAUDIO),y)
+obj-y += audio/sparcaudio.o
+endif
include $(TOPDIR)/Rules.make
Index: sbus.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/sbus.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- sbus.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ sbus.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -280,6 +280,8 @@
}
extern void register_proc_sparc_ioport(void);
+extern void firetruck_init(void);
+extern void rs_init(void);
void __init sbus_init(void)
{
@@ -310,7 +312,6 @@
prom_halt();
} else {
#ifdef __sparc_v9__
- extern void firetruck_init(void);
firetruck_init();
#endif
}
@@ -488,10 +489,10 @@
sun4d_init_sbi_irq();
}
+ rs_init();
+
#ifdef __sparc_v9__
if (sparc_cpu_model == sun4u) {
- extern void firetruck_init(void);
-
firetruck_init();
}
#endif
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:29
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/sgi In directory usw-pr-cvs1:/tmp/cvs-serv8509/sgi Modified Files: Makefile Log Message: synch 2.4.15 commit 52 Index: Makefile =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sgi/Makefile,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- Makefile 14 Jan 2001 18:57:55 -0000 1.1.1.1 +++ Makefile 11 Apr 2002 12:55:55 -0000 1.2 @@ -7,17 +7,13 @@ # # Note 2! The CFLAGS definitions are now in the main makefile... -SUB_DIRS := -MOD_SUB_DIRS := $(SUB_DIRS) char -ALL_SUB_DIRS := $(SUB_DIRS) char - - -L_OBJS := L_TARGET := sgi.a +# # Character and Audio devices for SGI machines. # -SUB_DIRS += char -L_OBJS += char/sgichar.o +subdir-y += char +subdir-m += char +obj-y += char/sgichar.o include $(TOPDIR)/Rules.make |
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:08
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/video/riva
In directory usw-pr-cvs1:/tmp/cvs-serv12946/video/riva
Modified Files:
accel.c fbdev.c rivafb.h
Log Message:
synch 2.4.15 commit 54
Index: accel.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/riva/accel.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- accel.c 25 Feb 2001 23:15:12 -0000 1.1.1.1
+++ accel.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -207,10 +207,11 @@
xx *= fontwidth(p);
yy *= fontheight(p);
+ c = scr_readw(s);
+ fgx = attr_fgcol(p, c);
+ bgx = attr_bgcol(p, c);
while (count--) {
c = scr_readw(s++);
- fgx = attr_fgcol(p,c);
- bgx = attr_bgcol(p,c);
fbcon_riva_writechr(conp, p, c, fgx, bgx, yy, xx);
xx += fontwidth(p);
}
@@ -321,12 +322,13 @@
xx *= fontwidth(p);
yy *= fontheight(p);
+ c = scr_readw(s);
+ fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
+ bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
+ if (p->var.green.length == 6)
+ convert_bgcolor_16(&bgx);
while (count--) {
c = scr_readw(s++);
- fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p,c)];
- bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p,c)];
- if (p->var.green.length == 6)
- convert_bgcolor_16(&bgx);
fbcon_riva_writechr(conp, p, c, fgx, bgx, yy, xx);
xx += fontwidth(p);
}
@@ -396,10 +398,11 @@
xx *= fontwidth(p);
yy *= fontheight(p);
+ c = scr_readw(s);
+ fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p, c)];
+ bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p, c)];
while (count--) {
c = scr_readw(s++);
- fgx = ((u32 *)p->dispsw_data)[attr_fgcol(p,c)];
- bgx = ((u32 *)p->dispsw_data)[attr_bgcol(p,c)];
fbcon_riva_writechr(conp, p, c, fgx, bgx, yy, xx);
xx += fontwidth(p);
}
Index: fbdev.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/riva/fbdev.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- fbdev.c 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ fbdev.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -191,6 +191,8 @@
PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_GEFORCE2_GTS },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_GEFORCE2_GTS },
+ { PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_GEFORCE2_ULTRA },
{ PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_QUADRO2_PRO,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_QUADRO2_PRO },
{ 0, } /* terminate list */
@@ -258,7 +260,7 @@
#endif
#ifndef MODULE
-static const char *mode_option __initdata = NULL;
+static char *mode_option __initdata = NULL;
#else
static char *font = NULL;
#endif
@@ -1107,6 +1109,9 @@
break;
#endif
#ifdef FBCON_HAS_CFB16
+ case 15:
+ rc = 15; /* fix for 15 bpp depths on Riva 128 based cards */
+ break;
case 16:
rc = 16; /* directcolor... 16 entries SW palette */
break; /* Mystique: truecolor, 16 entries SW palette, HW palette hardwired into 1:1 mapping */
@@ -1117,7 +1122,6 @@
break; /* Mystique: truecolor, 16 entries SW palette, HW palette hardwired into 1:1 mapping */
#endif
default:
- assert(0);
/* should not occur */
break;
}
@@ -2041,8 +2045,9 @@
if (!options || !*options)
return 0;
- for (this_opt = strtok(options, ","); this_opt;
- this_opt = strtok(NULL, ",")) {
+ while ((this_opt = strsep(&options, ",")) != NULL) {
+ if (!*this_opt)
+ continue;
if (!strncmp(this_opt, "font:", 5)) {
char *p;
int i;
@@ -2128,3 +2133,4 @@
MODULE_AUTHOR("Ani Joshi, maintainer");
MODULE_DESCRIPTION("Framebuffer driver for nVidia Riva 128, TNT, TNT2");
+MODULE_LICENSE("GPL");
Index: rivafb.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/riva/rivafb.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rivafb.h 25 Feb 2001 23:15:12 -0000 1.1.1.1
+++ rivafb.h 11 Apr 2002 13:26:54 -0000 1.2
@@ -82,4 +82,4 @@
#endif
};
-#endif /* __RIVAFB_H */
\ No newline at end of file
+#endif /* __RIVAFB_H */
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:07
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/rio
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/rio
Modified Files:
linux_compat.h rio.h rio_linux.c rio_linux.h rioboot.c
riocmd.c rioctrl.c riodrvr.h rioinit.c riointr.c rioroute.c
riotable.c riotty.c
Log Message:
synch 2.4.15 commit 55
Index: linux_compat.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/linux_compat.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- linux_compat.h 14 Jan 2001 18:01:02 -0000 1.1.1.1
+++ linux_compat.h 11 Apr 2002 13:31:05 -0000 1.2
@@ -16,11 +16,13 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#include <asm/hardirq.h>
+
#define disable(oldspl) save_flags (oldspl)
#define restore(oldspl) restore_flags (oldspl)
-#define sysbrk(x) kmalloc ((x), GFP_KERNEL)
+#define sysbrk(x) kmalloc ((x),in_interrupt()? GFP_ATOMIC : GFP_KERNEL)
#define sysfree(p,size) kfree ((p))
#define WBYTE(p,v) writeb(v, &p)
Index: rio.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rio.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rio.h 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rio.h 11 Apr 2002 13:31:05 -0000 1.2
@@ -210,16 +210,6 @@
#define RIO_PORT(DEV,FIRST_MAJ) ( (major(DEV) - FIRST_MAJ) * PORTS_PER_HOST) \
+ minor(DEV)
-/*
-** Min and Max
-*/
-#ifndef min
-#define min(A,B) ((A)<(B)?(A):(B))
-#endif
-#ifndef max
-#define max(A,B) ((A)>(B)?(A):(B))
-#endif
-
#define splrio spltty
#define RIO_IPL 5
Index: rio_linux.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rio_linux.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rio_linux.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rio_linux.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -27,8 +27,8 @@
*
* Revision history:
* $Log$
- * Revision 1.1.1.2 2001/02/25 23:15:04 kenn
- * Import official 2.4.2 Linus tree
+ * Revision 1.2 2002/04/11 13:31:05 atp
+ * synch 2.4.15 commit 55
*
* Revision 1.1 1999/07/11 10:13:54 wolff
* Initial revision
@@ -61,10 +61,14 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/miscdevice.h>
+#include <linux/init.h>
#include <linux/compatmac.h>
#include <linux/generic_serial.h>
+#if BITS_PER_LONG != 32
+# error FIXME: this driver only works on 32-bit platforms
+#endif
#include "linux_compat.h"
#include "typdef.h"
@@ -168,7 +172,7 @@
/* startuptime */ HZ*2, /* how long to wait for card to run */
/* slowcook */ 0, /* TRUE -> always use line disc. */
/* intrpolltime */ 1, /* The frequency of OUR polls */
- /* breakinterval */ 25, /* x10 mS */
+ /* breakinterval */ 25, /* x10 mS XXX: units seem to be 1ms not 10! -- REW*/
/* timer */ 10, /* mS */
/* RtaLoadBase */ 0x7000,
/* HostLoadBase */ 0x7C00,
@@ -206,11 +210,8 @@
unsigned int cmd, unsigned long arg);
static int rio_init_drivers(void);
-
void my_hd (void *addr, int len);
-
-
static struct tty_driver rio_driver, rio_callout_driver;
static struct tty_driver rio_driver2, rio_callout_driver2;
@@ -251,14 +252,13 @@
long rio_irqmask = -1;
#ifndef TWO_ZERO
-#ifdef MODULE
MODULE_AUTHOR("Rogier Wolff <R.E...@bi...>, Patrick van de Lageweg <pa...@bi...>");
MODULE_DESCRIPTION("RIO driver");
+MODULE_LICENSE("GPL");
MODULE_PARM(rio_poll, "i");
MODULE_PARM(rio_debug, "i");
MODULE_PARM(rio_irqmask, "i");
#endif
-#endif
static struct real_driver rio_real_driver = {
rio_disable_tx_interrupts,
@@ -386,8 +386,8 @@
int rio_ismodem (kdev_t device)
{
- return (MAJOR (device) != RIO_NORMAL_MAJOR0) &&
- (MAJOR (device) != RIO_NORMAL_MAJOR1);
+ return (MAJOR (device) == RIO_NORMAL_MAJOR0) ||
+ (MAJOR (device) == RIO_NORMAL_MAJOR1);
}
@@ -458,7 +458,6 @@
func_enter ();
HostP = (struct Host*)ptr; /* &p->RIOHosts[(long)ptr]; */
-
rio_dprintk (RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n",
irq, HostP->Ivec);
@@ -627,8 +626,12 @@
/* Nothing special here... */
static void rio_shutdown_port (void * ptr)
{
+ struct Port *PortP;
+
func_enter();
+ PortP = (struct Port *)ptr;
+ PortP->gs.tty = NULL;
#if 0
port->gs.flags &= ~ GS_ACTIVE;
if (!port->gs.tty) {
@@ -657,8 +660,14 @@
exit minicom. I expect an "oops". -- REW */
static void rio_hungup (void *ptr)
{
- func_enter ();
+ struct Port *PortP;
+
+ func_enter();
+
+ PortP = (struct Port *)ptr;
+ PortP->gs.tty = NULL;
rio_dec_mod_count ();
+
func_exit ();
}
@@ -682,9 +691,8 @@
PortP->gs.count = 0;
}
-
+ PortP->gs.tty = NULL;
rio_dec_mod_count ();
-
func_exit ();
}
@@ -703,24 +711,28 @@
return rc;
}
+extern int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+ int command, int len, int arg);
static int rio_ioctl (struct tty_struct * tty, struct file * filp,
unsigned int cmd, unsigned long arg)
{
-#if 0
int rc;
- struct rio_port *port = tty->driver_data;
+ struct Port *PortP;
int ival;
- /* func_enter2(); */
+ func_enter();
+ PortP = (struct Port *)tty->driver_data;
rc = 0;
switch (cmd) {
+#if 0
case TIOCGSOFTCAR:
rc = Put_user(((tty->termios->c_cflag & CLOCAL) ? 1 : 0),
(unsigned int *) arg);
break;
+#endif
case TIOCSSOFTCAR:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(int))) == 0) {
@@ -733,13 +745,39 @@
case TIOCGSERIAL:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
sizeof(struct serial_struct))) == 0)
- gs_getserial(&port->gs, (struct serial_struct *) arg);
+ gs_getserial(&PortP->gs, (struct serial_struct *) arg);
+ break;
+ case TCSBRK:
+ if ( PortP->State & RIO_DELETED ) {
+ rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rc = -EIO;
+ } else {
+ if (RIOShortCommand(p, PortP, SBREAK, 2, 250) == RIO_FAIL) {
+ rio_dprintk (RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
+ rc = -EIO;
+ }
+ }
+ break;
+ case TCSBRKP:
+ if ( PortP->State & RIO_DELETED ) {
+ rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rc = -EIO;
+ } else {
+ int l;
+ l = arg?arg*100:250;
+ if (l > 255) l = 255;
+ if (RIOShortCommand(p, PortP, SBREAK, 2, arg?arg*100:250) == RIO_FAIL) {
+ rio_dprintk (RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
+ rc = -EIO;
+ }
+ }
break;
case TIOCSSERIAL:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(struct serial_struct))) == 0)
- rc = gs_setserial(&port->gs, (struct serial_struct *) arg);
+ rc = gs_setserial(&PortP->gs, (struct serial_struct *) arg);
break;
+#if 0
case TIOCMGET:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
sizeof(unsigned int))) == 0) {
@@ -771,17 +809,13 @@
((ival & TIOCM_RTS) ? 1 : 0));
}
break;
-
+#endif
default:
rc = -ENOIOCTLCMD;
break;
}
- /* func_exit(); */
+ func_exit();
return rc;
-#else
- return -ENOIOCTLCMD;
-#endif
-
}
@@ -1032,15 +1066,15 @@
free4:kfree (rio_termios);
free3:kfree (p->RIOPortp);
free2:kfree (p->RIOHosts);
- free1:kfree (p);
- free0:
+ free1:
rio_dprintk (RIO_DEBUG_INIT, "Not enough memory! %p %p %p %p %p\n",
- p, p->RIOHosts, p->RIOPortp, rio_termios, rio_termios);
+ p, p->RIOHosts, p->RIOPortp, rio_termios, rio_termios);
+ kfree(p);
+ free0:
return -ENOMEM;
}
-#ifdef MODULE
-static void rio_release_drivers(void)
+static void __exit rio_release_drivers(void)
{
func_enter();
tty_unregister_driver (&rio_callout_driver2);
@@ -1049,7 +1083,6 @@
tty_unregister_driver (&rio_driver);
func_exit();
}
-#endif
#ifdef TWO_ZERO
#define PDEV unsigned char pci_bus, unsigned pci_fun
@@ -1102,11 +1135,7 @@
#endif
-#ifdef MODULE
-#define rio_init init_module
-#endif
-
-int rio_init(void)
+static int __init rio_init(void)
{
int found = 0;
int i;
@@ -1256,6 +1285,7 @@
hp->Type = RIO_PCI;
hp->Copy = rio_pcicopy;
hp->Mode = RIO_PCI_BOOT_FROM_RAM;
+ hp->HostLock = SPIN_LOCK_UNLOCKED;
rio_dprintk (RIO_DEBUG_PROBE, "Ivec: %x\n", hp->Ivec);
rio_dprintk (RIO_DEBUG_PROBE, "Mode: %x\n", hp->Mode);
@@ -1311,6 +1341,7 @@
* Moreover, the ISA card will work with the
* special PCI copy anyway. -- REW */
hp->Mode = 0;
+ hp->HostLock = SPIN_LOCK_UNLOCKED;
vpdp = get_VPD_PROM (hp);
rio_dprintk (RIO_DEBUG_PROBE, "Got VPD ROM\n");
@@ -1389,8 +1420,7 @@
}
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit rio_exit (void)
{
int i;
struct Host *hp;
@@ -1425,9 +1455,9 @@
func_exit();
}
-#endif
-
+module_init(rio_init);
+module_exit(rio_exit);
/*
* Anybody who knows why this doesn't work for me, please tell me -- REW.
Index: rio_linux.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rio_linux.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- rio_linux.h 14 Jan 2001 18:01:18 -0000 1.1.1.1
+++ rio_linux.h 11 Apr 2002 13:31:05 -0000 1.2
@@ -95,28 +95,27 @@
#if 1
#define rio_spin_lock_irqsave(sem, flags) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlockirqsave: %p %s:%d\n", \
- sem, __FILE__, __LINE__);\
- spin_lock_irqsave(sem, flags);\
- } while (0)
+ sem, __FILE__, __LINE__);\
+ spin_lock_irqsave(sem, flags);\
+ } while (0)
#define rio_spin_unlock_irqrestore(sem, flags) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlockirqrestore: %p %s:%d\n",\
- sem, __FILE__, __LINE__);\
- spin_unlock_irqrestore(sem, flags);\
- } while (0)
-
+ sem, __FILE__, __LINE__);\
+ spin_unlock_irqrestore(sem, flags);\
+ } while (0)
#define rio_spin_lock(sem) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinlock: %p %s:%d\n",\
- sem, __FILE__, __LINE__);\
- spin_lock(sem);\
- } while (0)
+ sem, __FILE__, __LINE__);\
+ spin_lock(sem);\
+ } while (0)
#define rio_spin_unlock(sem) do { \
rio_dprintk (RIO_DEBUG_SPINLOCK, "spinunlock: %p %s:%d\n",\
- sem, __FILE__, __LINE__);\
- spin_unlock(sem);\
- } while (0)
+ sem, __FILE__, __LINE__);\
+ spin_unlock(sem);\
+ } while (0)
#else
#define rio_spin_lock_irqsave(sem, flags) \
spin_lock_irqsave(sem, flags)
@@ -165,7 +164,7 @@
#define rio_memcpy_fromio memcpy_fromio
#endif
-#define DEBUG
+#define DEBUG 1
/*
Index: rioboot.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rioboot.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rioboot.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rioboot.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -38,6 +38,7 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/interrupt.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
Index: riocmd.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/riocmd.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- riocmd.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ riocmd.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -474,17 +474,18 @@
rio_spin_lock_irqsave(&PortP->portSem, flags);
switch( RBYTE(PktCmdP->Command) ) {
case BREAK_RECEIVED:
- rio_dprintk (RIO_DEBUG_CMD, "Received a break!\n");
+ rio_dprintk (RIO_DEBUG_CMD, "Received a break!\n");
/* If the current line disc. is not multi-threading and
the current processor is not the default, reset rup_intr
and return FALSE to ensure that the command packet is
not freed. */
/* Call tmgr HANGUP HERE */
/* Fix this later when every thing works !!!! RAMRAJ */
+ gs_got_break (&PortP->gs);
break;
case COMPLETE:
- rio_dprintk (RIO_DEBUG_CMD, "Command complete on phb %d host %d\n",
+ rio_dprintk (RIO_DEBUG_CMD, "Command complete on phb %d host %d\n",
RBYTE(PktCmdP->PhbNum), HostP-p->RIOHosts);
subCommand = 1;
switch (RBYTE(PktCmdP->SubCommand)) {
@@ -549,6 +550,8 @@
*/
if (PortP->gs.tty == NULL)
break;
+ if (PortP->gs.tty->termios == NULL)
+ break;
if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) &&
((PortP->State & (RIO_MOPEN|RIO_WOPEN)))) {
@@ -623,7 +626,8 @@
struct CmdBlk *CmdBlkP;
CmdBlkP = (struct CmdBlk *)sysbrk(sizeof(struct CmdBlk));
- bzero(CmdBlkP, sizeof(struct CmdBlk));
+ if (CmdBlkP)
+ bzero(CmdBlkP, sizeof(struct CmdBlk));
return CmdBlkP;
}
Index: rioctrl.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rioctrl.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rioctrl.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rioctrl.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -764,7 +764,7 @@
PortP->Config &= ~RIO_WAITDRAIN;
}
/*
- ** Store setings if locking or unlocking port or if the
+ ** Store settings if locking or unlocking port or if the
** port is not locked, when setting the store option.
*/
if (PortP->Mapped &&
Index: riodrvr.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/riodrvr.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- riodrvr.h 14 Jan 2001 18:01:38 -0000 1.1.1.1
+++ riodrvr.h 11 Apr 2002 13:31:05 -0000 1.2
@@ -33,12 +33,13 @@
#ifndef __riodrvr_h
#define __riodrvr_h
+#include <asm/param.h> /* for HZ */
+
#ifdef SCCS_LABELS
static char *_riodrvr_h_sccs_ = "@(#)riodrvr.h 1.3";
#endif
#define MEMDUMP_SIZE 32
-#define HZ 100
#define MOD_DISABLE (RIO_NOREAD|RIO_NOWRITE|RIO_NOXPRINT)
Index: rioinit.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rioinit.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rioinit.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rioinit.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -1446,7 +1446,7 @@
}
RIODefaultName(p, HostP, rup);
}
- HostP->UnixRups[rup].RupLock = -1;
+ HostP->UnixRups[rup].RupLock = SPIN_LOCK_UNLOCKED;
}
}
}
Index: riointr.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/riointr.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- riointr.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ riointr.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -819,7 +819,7 @@
** and available space.
*/
- transCount = min(PacketP->len & PKT_LEN_MASK,
+ transCount = min_t(unsigned int, PacketP->len & PKT_LEN_MASK,
TTY_FLIPBUF_SIZE - TtyP->flip.count);
rio_dprintk (RIO_DEBUG_REC, "port %d: Copy %d bytes\n",
PortP->PortNum, transCount);
Index: rioroute.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/rioroute.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- rioroute.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ rioroute.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -657,6 +657,7 @@
*/
if (PortP->TxStart == 0) {
rio_dprintk (RIO_DEBUG_ROUTE, "Tx pkts not set up yet\n");
+ rio_spin_unlock_irqrestore(&PortP->portSem, flags);
break;
}
Index: riotable.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/riotable.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- riotable.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ riotable.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -37,6 +37,8 @@
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/errno.h>
+#include <linux/interrupt.h>
+
#include <asm/io.h>
#include <asm/system.h>
#include <asm/string.h>
@@ -443,7 +445,7 @@
int Next = 0;
struct Map *MapP;
struct Host *HostP;
- int oldspl;
+ long oldspl;
disable(oldspl); /* strange but true! */
@@ -499,7 +501,7 @@
struct Map *HostMapP;
struct Port *PortP;
int work_done = 0;
- unsigned long flags;
+ unsigned long lock_flags, sem_flags;
rio_dprintk (RIO_DEBUG_TABLE, "Delete entry on host %x, rta %x\n",
MapP->HostUniqueNum, MapP->RtaUniqueNum);
@@ -507,10 +509,10 @@
for ( host=0; host < p->RIONumHosts; host++ ) {
HostP = &p->RIOHosts[host];
- rio_spin_lock_irqsave( &HostP->HostLock, flags );
+ rio_spin_lock_irqsave( &HostP->HostLock, lock_flags );
if ( (HostP->Flags & RUN_STATE) != RC_RUNNING ) {
- rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
+ rio_spin_unlock_irqrestore(&HostP->HostLock, lock_flags);
continue;
}
@@ -527,7 +529,7 @@
if ( HostMapP->Topology[link].Unit != ROUTE_DISCONNECT ) {
rio_dprintk (RIO_DEBUG_TABLE, "Entry is in use and cannot be deleted!\n");
p->RIOError.Error = UNIT_IS_IN_USE;
- rio_spin_unlock_irqrestore( &HostP->HostLock, flags);
+ rio_spin_unlock_irqrestore( &HostP->HostLock, lock_flags);
return EBUSY;
}
}
@@ -542,7 +544,7 @@
PortP = p->RIOPortp[port];
rio_dprintk (RIO_DEBUG_TABLE, "Unmap port\n");
- rio_spin_lock_irqsave( &PortP->portSem, flags );
+ rio_spin_lock_irqsave( &PortP->portSem, sem_flags );
PortP->Mapped = 0;
@@ -600,7 +602,7 @@
WWORD(PortP->PhbP->destination,
dest_unit + (dest_port << 8));
}
- rio_spin_unlock_irqrestore(&PortP->portSem, flags);
+ rio_spin_unlock_irqrestore(&PortP->portSem, sem_flags);
}
}
rio_dprintk (RIO_DEBUG_TABLE, "Entry nulled.\n");
@@ -608,7 +610,7 @@
work_done++;
}
}
- rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
+ rio_spin_unlock_irqrestore(&HostP->HostLock, lock_flags);
}
/* XXXXX lock me up */
Index: riotty.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/rio/riotty.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- riotty.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ riotty.c 11 Apr 2002 13:31:05 -0000 1.2
@@ -96,7 +96,7 @@
#endif
static void RIOClearUp(struct Port *PortP);
-static int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+int RIOShortCommand(struct rio_info *p, struct Port *PortP,
int command, int len, int arg);
@@ -452,8 +452,11 @@
PortP->gs.tty->termios->c_state |= WOPEN;
*/
PortP->State |= RIO_WOPEN;
+ rio_spin_unlock_irqrestore(&PortP->portSem, flags);
+ if (RIODelay (PortP, HUNDRED_MS) == RIO_FAIL)
#if 0
if ( sleep((caddr_t)&tp->tm.c_canqo, TTIPRI|PCATCH))
+#endif
{
/*
** ACTION: verify that this is a good thing
@@ -471,7 +474,6 @@
func_exit ();
return -EINTR;
}
-#endif
}
PortP->State &= ~RIO_WOPEN;
}
@@ -527,8 +529,10 @@
#endif
struct Port *PortP =ptr; /* pointer to the port structure */
int deleted = 0;
- int try = 25;
- int repeat_this = 0xff;
+ int try = -1; /* Disable the timeouts by setting them to -1 */
+ int repeat_this = -1; /* Congrats to those having 15 years of
+ uptime! (You get to break the driver.) */
+ long end_time;
struct tty_struct * tty;
unsigned long flags;
int Modem;
@@ -541,6 +545,12 @@
/* tp = PortP->TtyP;*/ /* Get tty */
tty = PortP->gs.tty;
rio_dprintk (RIO_DEBUG_TTY, "TTY is at address 0x%x\n",(int)tty);
+
+ if (PortP->gs.closing_wait)
+ end_time = jiffies + PortP->gs.closing_wait;
+ else
+ end_time = jiffies + MAX_SCHEDULE_TIMEOUT;
+
Modem = rio_ismodem(tty->device);
#if 0
/* What F.CKING cache? Even then, a higly idle multiprocessor,
@@ -573,7 +583,8 @@
** clear the open bits for this device
*/
PortP->State &= (Modem ? ~RIO_MOPEN : ~RIO_LOPEN);
-
+ PortP->State &= ~RIO_CARR_ON;
+ PortP->ModemState &= ~MSVR1_CD;
/*
** If the device was open as both a Modem and a tty line
** then we need to wimp out here, as the port has not really
@@ -605,7 +616,6 @@
*/
rio_dprintk (RIO_DEBUG_TTY, "Timeout 1 starts\n");
-#if 0
if (!deleted)
while ( (PortP->InUse != NOT_INUSE) && !p->RIOHalted &&
(PortP->TxBufferIn != PortP->TxBufferOut) ) {
@@ -626,7 +636,7 @@
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
}
-#endif
+
PortP->TxBufferIn = PortP->TxBufferOut = 0;
repeat_this = 0xff;
@@ -662,7 +672,7 @@
if (!deleted)
while (try && (PortP->PortState & PORT_ISOPEN)) {
try--;
- if (try == 0) {
+ if (time_after (jiffies, end_time)) {
rio_dprintk (RIO_DEBUG_TTY, "Run out of tries - force the bugger shut!\n" );
RIOPreemptiveCmd(p, PortP,FCLOSE);
break;
@@ -674,7 +684,11 @@
RIOClearUp( PortP );
goto close_end;
}
- RIODelay_ni(PortP, HUNDRED_MS);
+ if (RIODelay(PortP, HUNDRED_MS) == RIO_FAIL) {
+ rio_dprintk (RIO_DEBUG_TTY, "RTA EINTR in delay \n");
+ RIOPreemptiveCmd(p, PortP,FCLOSE);
+ break;
+ }
}
rio_spin_lock_irqsave(&PortP->portSem, flags);
rio_dprintk (RIO_DEBUG_TTY, "Close: try was %d on completion\n", try );
@@ -779,7 +793,7 @@
** Other values of len aren't allowed, and will cause
** a panic.
*/
-static int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+int RIOShortCommand(struct rio_info *p, struct Port *PortP,
int command, int len, int arg)
{
PKT *PacketP;
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:07
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio
In directory usw-pr-cvs1:/tmp/cvs-serv8509/sbus/audio
Modified Files:
Makefile amd7930.c amd7930.h audio.c cs4215.h cs4231.c
cs4231.h dbri.c dbri.h dmy.c dummy.h
Log Message:
synch 2.4.15 commit 52
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:45:59 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 12:55:56 -0000 1.2
@@ -11,8 +11,8 @@
obj-$(CONFIG_SPARCAUDIO) += audio.o
obj-$(CONFIG_SPARCAUDIO_AMD7930) += amd7930.o
-obj-$(CONFIG_SPARCAUDIO_CS4231) += cs4231.o
obj-$(CONFIG_SPARCAUDIO_DBRI) += dbri.o
+obj-$(CONFIG_SPARCAUDIO_CS4231) += cs4231.o
obj-$(CONFIG_SPARCAUDIO_DUMMY) += dmy.o
include $(TOPDIR)/Rules.make
Index: amd7930.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/amd7930.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- amd7930.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ amd7930.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -107,7 +107,7 @@
static __u8 linear2mulaw(__u16 data);
static __u16 mulaw2linear(__u8 data);
-#if defined (AMD79C30_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
+#if defined (AMD79C30_ISDN)
#include "../../isdn/hisax/hisax.h"
#include "../../isdn/hisax/isdnl1.h"
#include "../../isdn/hisax/foreign.h"
@@ -1131,7 +1131,7 @@
*
*/
-#if defined (AMD79C30_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
+#if defined (AMD79C30_ISDN)
static int amd7930_get_irqnum(int dev)
{
struct amd7930_info *info;
@@ -1659,9 +1659,8 @@
return 0;
}
-#ifdef MODULE
/* Detach from an amd7930 chip given the device structure. */
-static void amd7930_detach(struct sparcaudio_driver *drv)
+static void __exit amd7930_detach(struct sparcaudio_driver *drv)
{
struct amd7930_info *info = (struct amd7930_info *)drv->private;
@@ -1672,14 +1671,9 @@
sbus_iounmap(info->regs, info->regs_size);
kfree(drv->private);
}
-#endif
/* Probe for the amd7930 chip and then attach the driver. */
-#ifdef MODULE
-int init_module(void)
-#else
-int __init amd7930_init(void)
-#endif
+static int __init amd7930_init(void)
{
struct sbus_bus *sbus;
struct sbus_dev *sdev;
@@ -1710,8 +1704,7 @@
return (num_drivers > 0) ? 0 : -EIO;
}
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit amd7930_exit(void)
{
register int i;
@@ -1720,8 +1713,10 @@
num_drivers--;
}
}
-#endif
+module_init(amd7930_init);
+module_exit(amd7930_exit);
+MODULE_LICENSE("GPL");
/*************************************************************/
/* Audio format conversion */
Index: amd7930.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/amd7930.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: audio.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/audio.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- audio.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ audio.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -32,10 +32,11 @@
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/soundcard.h>
-#include <linux/version.h>
#include <linux/devfs_fs_kernel.h>
#include <linux/delay.h>
+#include <linux/poll.h>
#include <asm/pgtable.h>
+#include <asm/uaccess.h>
#include <asm/audioio.h>
@@ -73,24 +74,6 @@
static struct sparcaudio_driver *drivers[SPARCAUDIO_MAX_DEVICES];
static devfs_handle_t devfs_handle;
-/* This crap to be pulled off into a local include file */
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
-
-#define COPY_IN(arg, get) verify_area(VERIFY_READ, (void *)arg, sizeof(long)); memcpy_fromfs(&get, (long *)arg, sizeof(get));
-#define COPY_OUT(arg, ret) verify_area(VERIFY_WRITE, (void *)arg, sizeof(long)); memcpy_tofs((long *)arg, &ret, sizeof(ret));
-#define copy_to_user memcpy_tofs
-#define copy_from_user memcpy_fromfs
-#define signal_pending(x) (((x)->signal) & ~((x)->blocked))
-
-#else
-
-#include <asm/uaccess.h>
-#include <linux/poll.h>
-#define COPY_IN(arg, get) get_user(get, (int *)arg)
-#define COPY_OUT(arg, ret) put_user(ret, (int *)arg)
-#define sparcaudio_select sparcaudio_poll
-
-#endif
void sparcaudio_output_done(struct sparcaudio_driver * drv, int status)
{
@@ -215,37 +198,6 @@
* VFS layer interface
*/
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
-static int sparcaudio_select(struct inode * inode, struct file * file,
- int sel_type, select_table * wait)
-{
- struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >>
- SPARCAUDIO_DEVICE_SHIFT)];
-
- switch (sel_type) {
- case SEL_IN:
- if (((!file->f_flags & O_NONBLOCK) && drv->input_count) ||
- (drv->input_size > drv->buffer_size)) {
- dprintk(("read ready: c%d o%d\n",
- drv->input_count, drv->input_offset));
- return 1;
- }
- select_wait(&drv->input_read_wait, wait);
- break;
- case SEL_OUT:
- dprintk(("sel out: c%d o%d p%d\n",
- drv->output_count, drv->output_offset, drv->playing_count));
- if ((drv->output_count + drv->playing_count) < (drv->num_output_buffers))
- return 1;
- select_wait(&drv->output_write_wait, wait);
- break;
- case SEL_EX:
- break;
- };
-
- return 0;
-}
-#else
static unsigned int sparcaudio_poll(struct file *file, poll_table * wait)
{
unsigned int mask = 0;
@@ -264,29 +216,11 @@
}
return mask;
}
-#endif
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
-static int sparcaudio_lseek(struct inode * inode, struct file * file,
- off_t offset, int origin)
-#else
-static loff_t sparcaudio_lseek(struct file * file, loff_t offset, int origin)
-#endif
-{
- return -ESPIPE;
-}
-
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
-static int sparcaudio_read(struct inode * inode, struct file * file,
- char *buf, int count)
-#else
static ssize_t sparcaudio_read(struct file * file, char *buf,
size_t count, loff_t *ppos)
-#endif
{
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
struct inode *inode = file->f_dentry->d_inode;
-#endif
struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >>
SPARCAUDIO_DEVICE_SHIFT)];
int bytes_to_copy, bytes_read = 0, err;
@@ -358,17 +292,10 @@
restore_flags(flags);
}
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
-static int sparcaudio_write(struct inode * inode, struct file * file,
- const char *buf, int count)
-#else
static ssize_t sparcaudio_write(struct file * file, const char *buf,
size_t count, loff_t *ppos)
-#endif
{
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
struct inode *inode = file->f_dentry->d_inode;
-#endif
struct sparcaudio_driver *drv = drivers[(MINOR(inode->i_rdev) >>
SPARCAUDIO_DEVICE_SHIFT)];
int bytes_written = 0, bytes_to_copy, err;
@@ -499,7 +426,7 @@
switch (cmd) {
case SOUND_MIXER_WRITE_RECLEV:
- if(COPY_IN(arg, k))
+ if (get_user(k, (int *)arg))
return -EFAULT;
iretry:
oprintk(("setting input volume (0x%x)", k));
@@ -531,9 +458,9 @@
oprintk((" try 0x%x\n", k));
goto iretry;
}
- return COPY_OUT(arg, i);
+ return put_user(i, (int *)arg);
case SOUND_MIXER_WRITE_VOLUME:
- if(COPY_IN(arg, k))
+ if (get_user(k, (int *)arg))
return -EFAULT;
if (drv->ops->get_output_muted && drv->ops->set_output_muted) {
i = drv->ops->get_output_muted(drv);
@@ -546,9 +473,9 @@
if (drv->ops->get_output_muted)
i = drv->ops->get_output_muted(drv);
k = 0x6464 * (1 - i);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_WRITE_PCM:
- if(COPY_IN(arg, k))
+ if (get_user(k, (int *)arg))
return -EFAULT;
oretry:
oprintk(("setting output volume (0x%x)\n", k));
@@ -582,25 +509,25 @@
oprintk((" try 0x%x\n", k));
goto oretry;
}
- return COPY_OUT(arg, i);
+ return put_user(i, (int *)arg);
case SOUND_MIXER_READ_SPEAKER:
k = OSS_PORT_AUDIO(drv, AUDIO_SPEAKER);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_MIC:
k = OSS_IPORT_AUDIO(drv, AUDIO_MICROPHONE);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_CD:
k = OSS_IPORT_AUDIO(drv, AUDIO_CD);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_LINE:
k = OSS_IPORT_AUDIO(drv, AUDIO_LINE_IN);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_LINE1:
k = OSS_PORT_AUDIO(drv, AUDIO_HEADPHONE);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_LINE2:
k = OSS_PORT_AUDIO(drv, AUDIO_LINE_OUT);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_WRITE_MIC:
case SOUND_MIXER_WRITE_CD:
@@ -608,7 +535,7 @@
case SOUND_MIXER_WRITE_LINE1:
case SOUND_MIXER_WRITE_LINE2:
case SOUND_MIXER_WRITE_SPEAKER:
- if(COPY_IN(arg, k))
+ if (get_user(k, (int *)arg))
return -EFAULT;
OSS_TWIDDLE_IPORT(drv, cmd, SOUND_MIXER_WRITE_LINE, AUDIO_LINE_IN, k);
OSS_TWIDDLE_IPORT(drv, cmd, SOUND_MIXER_WRITE_MIC, AUDIO_MICROPHONE, k);
@@ -617,7 +544,7 @@
OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_SPEAKER, AUDIO_SPEAKER, k);
OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_LINE1, AUDIO_HEADPHONE, k);
OSS_TWIDDLE_PORT(drv, cmd, SOUND_MIXER_WRITE_LINE2, AUDIO_LINE_OUT, k);
- return COPY_OUT(arg, k);
+ return put_user(k, (int *)arg);
case SOUND_MIXER_READ_RECSRC:
if (drv->ops->get_input_port)
i = drv->ops->get_input_port(drv);
@@ -627,11 +554,11 @@
if (i & AUDIO_LINE_IN) j = SOUND_MASK_LINE;
if (i & AUDIO_MICROPHONE) j = SOUND_MASK_MIC;
- return COPY_OUT(arg, j);
+ return put_user(j, (int *)arg);
case SOUND_MIXER_WRITE_RECSRC:
if (!drv->ops->set_input_port)
return -EINVAL;
- if(COPY_IN(arg, k))
+ if (get_user(k, (int *)arg))
return -EFAULT;
/* only one should ever be selected */
@@ -641,7 +568,7 @@
oprintk(("setting inport to %d\n", j));
i = drv->ops->set_input_port(drv, j);
- return COPY_OUT(arg, i);
+ return put_user(i, (int *)arg);
case SOUND_MIXER_READ_RECMASK:
if (drv->ops->get_input_ports)
i = drv->ops->get_input_ports(drv);
@@ -650,10 +577,10 @@
if (i & AUDIO_LINE_IN) j |= SOUND_MASK_LINE;
if (i & AUDIO_CD) j |= SOUND_MASK_CD;
- return COPY_OUT(arg, j);
+ return put_user(j, (int *)arg);
case SOUND_MIXER_READ_CAPS: /* mixer capabilities */
i = SOUND_CAP_EXCL_INPUT;
- return COPY_OUT(arg, i);
+ return put_user(i, (int *)arg);
case SOUND_MIXER_READ_DEVMASK: /* all supported devices */
if (drv->ops->get_input_ports)
@@ -676,7 +603,7 @@
if (cmd == SOUND_MIXER_READ_STEREODEVS)
j &= ~(MONO_DEVICES);
- return COPY_OUT(arg, j);
+ return put_user(j, (int *)arg);
default:
return -EINVAL;
};
@@ -742,7 +669,7 @@
case I_GETSIG:
case I_GETSIG_SOLARIS:
j = (int) lis_get_elist_ent(drv->sd_siglist,current->pid);
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
retval = drv->input_count;
break;
@@ -773,7 +700,7 @@
* as its retval. (streamio(7I)) This should work.
*/
j = (drv->input_count > 0) ? drv->input_buffer_size : 0;
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
retval = drv->input_count;
break;
@@ -859,11 +786,11 @@
if (drv->ops->get_output_pause(drv))
j |= PCM_ENABLE_OUTPUT;
}
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
break;
case SNDCTL_DSP_GETBLKSIZE:
j = drv->input_buffer_size;
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
break;
case SNDCTL_DSP_SPEED:
if ((!drv->ops->set_output_rate) &&
@@ -871,12 +798,12 @@
retval = -EINVAL;
break;
}
- COPY_IN(arg, i);
+ get_user(i, (int *)arg)
tprintk(("setting speed to %d\n", i));
drv->ops->set_input_rate(drv, i);
drv->ops->set_output_rate(drv, i);
j = drv->ops->get_output_rate(drv);
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
break;
case SNDCTL_DSP_GETCAPS:
/* All Sparc audio hardware is full duplex.
@@ -884,19 +811,19 @@
* Pause functionality emulates trigger
*/
j = DSP_CAP_DUPLEX | DSP_CAP_TRIGGER | DSP_CAP_REALTIME;
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
break;
case SNDCTL_DSP_GETFMTS:
if (drv->ops->get_formats) {
j = drv->ops->get_formats(drv);
- COPY_OUT(arg, j);
+ put_user(j, (int *)arg);
} else {
retval = -EINVAL;
}
break;
case SNDCTL_DSP_SETFMT:
/* need to decode into encoding, precision */
- COPY_IN(arg, i);
+ get_user(i, (int *)arg);
/* handle special case here */
if (i == AFMT_QUERY) {
@@ -926,7 +853,7 @@
break;
};
}
- COPY_OUT(arg, i);
+ put_user(i, (int *)arg);
break;
}
@@ -991,7 +918,7 @@
dprintk(("setting format: failed\n"));
return -EINVAL;
}
- COPY_OUT(arg, i);
+ put_user(i, (int *)arg);
break;
case SNDCTL_DSP_CHANNELS:
if ((!drv->ops->set_output_channels) &&
@@ -999,11 +926,11 @@
retval = -EINVAL;
break;
}
- COPY_IN(arg, i);
+ get_user(i, (int *)arg);
drv->ops->set_input_channels(drv, i);
drv->ops->set_output_channels(drv, i);
i = drv->ops->get_output_channels(drv);
- COPY_OUT(arg, i);
+ put_user(i, (int *)arg);
break;
case SNDCTL_DSP_STEREO:
if ((!drv->ops->set_output_channels) &&
@@ -1011,11 +938,11 @@
retval = -EINVAL;
break;
}
- COPY_IN(arg, i);
+ get_user(i, (int *)arg);
drv->ops->set_input_channels(drv, (i + 1));
drv->ops->set_output_channels(drv, (i + 1));
i = ((drv->ops->get_output_channels(drv)) - 1);
- COPY_OUT(arg, i);
+ put_user(i, (int *)arg);
break;
case SNDCTL_DSP_POST:
case SNDCTL_DSP_SYNC:
@@ -1761,14 +1688,14 @@
default:
eprintk(("unknown minor device number\n"));
retval = -EINVAL;
- };
+ }
return retval;
}
static struct file_operations sparcaudioctl_fops = {
owner: THIS_MODULE,
- poll: sparcaudio_select,
+ poll: sparcaudio_poll,
ioctl: sparcaudio_ioctl,
};
@@ -1960,10 +1887,10 @@
static struct file_operations sparcaudio_fops = {
owner: THIS_MODULE,
- llseek: sparcaudio_lseek,
+ llseek: no_llseek,
read: sparcaudio_read,
write: sparcaudio_write,
- poll: sparcaudio_select,
+ poll: sparcaudio_poll,
ioctl: sparcaudio_ioctl,
open: sparcaudio_open,
release: sparcaudio_release,
@@ -2032,12 +1959,10 @@
* TODO: Make number of input/output buffers tunable parameters
*/
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x202ff
init_waitqueue_head(&drv->open_wait);
init_waitqueue_head(&drv->output_write_wait);
init_waitqueue_head(&drv->output_drain_wait);
init_waitqueue_head(&drv->input_read_wait);
-#endif
drv->num_output_buffers = 8;
drv->output_buffer_size = (4096 * 2);
@@ -2204,20 +2129,6 @@
return -EIO;
devfs_handle = devfs_mk_dir (NULL, "sound", NULL);
-
-#ifdef CONFIG_SPARCAUDIO_AMD7930
- amd7930_init();
-#endif
-#ifdef CONFIG_SPARCAUDIO_DBRI
- dbri_init();
-#endif
-#ifdef CONFIG_SPARCAUDIO_CS4231
- cs4231_init();
-#endif
-#ifdef CONFIG_SPARCAUDIO_DUMMY
- dummy_init();
-#endif
-
return 0;
}
@@ -2227,8 +2138,9 @@
devfs_unregister (devfs_handle);
}
-module_init(sparcaudio_init)
-module_exit(sparcaudio_exit)
+module_init(sparcaudio_init);
+module_exit(sparcaudio_exit);
+MODULE_LICENSE("GPL");
/*
* Code from Linux Streams, Copyright 1995 by
Index: cs4215.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4215.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: cs4231.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4231.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- cs4231.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ cs4231.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -35,7 +35,7 @@
#include <asm/io.h>
#include <asm/pgtable.h>
#include <asm/sbus.h>
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff && defined(CONFIG_PCI)
+#ifdef CONFIG_PCI
#define EB4231_SUPPORT
#include <asm/ebus.h>
#include <asm/pbm.h>
@@ -2178,9 +2178,6 @@
static int cs4231_attach(struct sparcaudio_driver *drv,
struct sbus_dev *sdev)
{
-#if defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE < 0x20100
- struct linux_prom_irqs irq;
-#endif
struct cs4231_chip *cs4231_chip;
int err;
@@ -2348,12 +2345,51 @@
}
#endif
-/* Probe for the cs4231 chip and then attach the driver. */
-#ifdef MODULE
-int init_module(void)
-#else
-int __init cs4231_init(void)
+#ifdef EB4231_SUPPORT
+static int __init ebus_cs4231_p(struct linux_ebus_device *edev)
+{
+ if (!strcmp(edev->prom_name, "SUNW,CS4231"))
+ return 1;
+ if (!strcmp(edev->prom_name, "audio")) {
+ char compat[16];
+
+ prom_getstring(edev->prom_node, "compatible",
+ compat, sizeof(compat));
+ compat[15] = '\0';
+ if (!strcmp(compat, "SUNW,CS4231"))
+ return 1;
+ }
+
+ return 0;
+}
#endif
+
+/* Detach from an cs4231 chip given the device structure. */
+static void __exit cs4231_detach(struct sparcaudio_driver *drv)
+{
+ struct cs4231_chip *cs4231_chip = (struct cs4231_chip *) drv->private;
+
+ cs4231_disable_interrupts(drv);
+ unregister_sparcaudio_driver(drv, 1);
+ disable_irq(cs4231_chip->irq);
+ free_irq(cs4231_chip->irq, drv);
+ if (!(cs4231_chip->status & CS_STATUS_IS_EBUS)) {
+ sbus_iounmap(cs4231_chip->regs, cs4231_chip->regs_size);
+ } else {
+#ifdef EB4231_SUPPORT
+ iounmap(cs4231_chip->regs);
+ iounmap(cs4231_chip->eb2p);
+ iounmap(cs4231_chip->eb2c);
+ disable_irq(cs4231_chip->irq2);
+ free_irq(cs4231_chip->irq2, drv);
+#endif
+ }
+ kfree(drv->private);
+}
+
+
+/* Probe for the cs4231 chip and then attach the driver. */
+static int __init cs4231_init(void)
{
struct sbus_bus *sbus;
struct sbus_dev *sdev;
@@ -2379,7 +2415,7 @@
#ifdef EB4231_SUPPORT
for_each_ebus(ebus) {
for_each_ebusdev(edev, ebus) {
- if (!strcmp(edev->prom_name, "SUNW,CS4231")) {
+ if (ebus_cs4231_p(edev)) {
/* Don't go over the max number of drivers. */
if (num_drivers >= MAX_DRIVERS)
continue;
@@ -2395,31 +2431,7 @@
return (num_drivers > 0) ? 0 : -EIO;
}
-#ifdef MODULE
-/* Detach from an cs4231 chip given the device structure. */
-static void cs4231_detach(struct sparcaudio_driver *drv)
-{
- struct cs4231_chip *cs4231_chip = (struct cs4231_chip *) drv->private;
-
- cs4231_disable_interrupts(drv);
- unregister_sparcaudio_driver(drv, 1);
- disable_irq(cs4231_chip->irq);
- free_irq(cs4231_chip->irq, drv);
- if (!(cs4231_chip->status & CS_STATUS_IS_EBUS)) {
- sbus_iounmap(cs4231_chip->regs, cs4231_chip->regs_size);
- } else {
-#ifdef EB4231_SUPPORT
- iounmap(cs4231_chip->regs);
- iounmap(cs4231_chip->eb2p);
- iounmap(cs4231_chip->eb2c);
- disable_irq(cs4231_chip->irq2);
- free_irq(cs4231_chip->irq2, drv);
-#endif
- }
- kfree(drv->private);
-}
-
-void cleanup_module(void)
+static void __exit cs4231_exit(void)
{
register int i;
@@ -2428,8 +2440,10 @@
num_drivers--;
}
}
-#endif
+module_init(cs4231_init);
+module_exit(cs4231_exit);
+MODULE_LICENSE("GPL");
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* Emacs will notice this stuff at the end of the file and automatically
Index: cs4231.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/cs4231.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: dbri.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dbri.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- dbri.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ dbri.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -61,7 +61,7 @@
#include <asm/audioio.h>
#include "dbri.h"
-#if defined(DBRI_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
+#if defined(DBRI_ISDN)
#include "../../isdn/hisax/hisax.h"
#include "../../isdn/hisax/isdnl1.h"
#include "../../isdn/hisax/foreign.h"
@@ -2227,7 +2227,7 @@
recv_on_pipe(dbri, 8+chan, buffer, size, callback, callback_arg);
}
-#if defined(DBRI_ISDN) && defined (LINUX_VERSION_CODE) && LINUX_VERSION_CODE > 0x200ff
+#if defined(DBRI_ISDN)
struct foreign_interface dbri_foreign_interface = {
dbri_get_irqnum,
dbri_get_liu_state,
@@ -2336,11 +2336,7 @@
}
/* Probe for the dbri chip and then attach the driver. */
-#ifdef MODULE
-int init_module(void)
-#else
-int __init dbri_init(void)
-#endif
+static int __init dbri_init(void)
{
struct sbus_bus *sbus;
struct sbus_dev *sdev;
@@ -2368,8 +2364,7 @@
return (num_drivers > 0) ? 0 : -EIO;
}
-#ifdef MODULE
-void cleanup_module(void)
+static void __exit dbri_exit(void)
{
register int i;
@@ -2379,7 +2374,10 @@
num_drivers--;
}
}
-#endif
+
+module_init(dbri_init);
+module_exit(dbri_exit);
+MODULE_LICENSE("GPL");
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
Index: dbri.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dbri.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
Index: dmy.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dmy.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- dmy.c 25 Feb 2001 23:15:10 -0000 1.1.1.2
+++ dmy.c 11 Apr 2002 12:55:56 -0000 1.2
@@ -36,7 +36,7 @@
static int dummy_record_gain(struct sparcaudio_driver *drv, int value,
unsigned char balance);
static int dummy_output_muted(struct sparcaudio_driver *drv, int value);
-static int dummy_attach(struct sparcaudio_driver *drv);
+static int dummy_attach(struct sparcaudio_driver *drv) __init;
static int
dummy_set_output_encoding(struct sparcaudio_driver *drv, int value)
@@ -710,25 +710,8 @@
dummy_get_formats,
};
-/* Probe for the dummy chip and then attach the driver. */
-#ifdef MODULE
-int init_module(void)
-#else
-int __init dummy_init(void)
-#endif
-{
- num_drivers = 0;
-
- /* Add support here for specifying multiple dummies to attach at once. */
- if (dummy_attach(&drivers[num_drivers]) == 0)
- num_drivers++;
-
- /* Only return success if we found some dummy chips. */
- return (num_drivers > 0) ? 0 : -EIO;
-}
-
/* Attach to an dummy chip given its PROM node. */
-static int dummy_attach(struct sparcaudio_driver *drv)
+static int __init dummy_attach(struct sparcaudio_driver *drv)
{
struct dummy_chip *dummy_chip;
int err;
@@ -768,15 +751,27 @@
return 0;
}
-#ifdef MODULE
/* Detach from an dummy chip given the device structure. */
-static void dummy_detach(struct sparcaudio_driver *drv)
+static void __exit dummy_detach(struct sparcaudio_driver *drv)
{
unregister_sparcaudio_driver(drv, 2);
kfree(drv->private);
}
-void cleanup_module(void)
+/* Probe for the dummy chip and then attach the driver. */
+static int __init dummy_init(void)
+{
+ num_drivers = 0;
+
+ /* Add support here for specifying multiple dummies to attach at once. */
+ if (dummy_attach(&drivers[num_drivers]) == 0)
+ num_drivers++;
+
+ /* Only return success if we found some dummy chips. */
+ return (num_drivers > 0) ? 0 : -EIO;
+}
+
+static void __exit dummy_exit(void)
{
int i;
@@ -785,7 +780,10 @@
num_drivers--;
}
}
-#endif
+
+module_init(dummy_init);
+module_exit(dummy_exit);
+MODULE_LICENSE("GPL");
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
Index: dummy.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/sbus/audio/dummy.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:07
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/char/pcmcia
In directory usw-pr-cvs1:/tmp/cvs-serv17293/char/pcmcia
Modified Files:
Config.in Makefile serial_cs.c
Removed Files:
serial_cb.c
Log Message:
synch 2.4.15 commit 55
Index: Config.in
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/pcmcia/Config.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Config.in 14 Jan 2001 18:03:48 -0000 1.1.1.1
+++ Config.in 11 Apr 2002 13:31:04 -0000 1.2
@@ -2,29 +2,13 @@
# PCMCIA character device configuration
#
-if [ "$CONFIG_SERIAL" = "n" ]; then
- define_tristate CONFIG_PCMCIA_SERIAL n
-else
- if [ "$CONFIG_SERIAL" = "m" -o "$CONFIG_PCMCIA" = "m" ]; then
- define_tristate CONFIG_PCMCIA_SERIAL m
- else
- define_tristate CONFIG_PCMCIA_SERIAL y
- fi
-fi
-
-if [ "$CONFIG_PCMCIA_SERIAL" != "n" ]; then
- mainmenu_option next_comment
- comment 'PCMCIA character device support'
+mainmenu_option next_comment
+comment 'PCMCIA character devices'
- dep_tristate 'PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_PCMCIA_SERIAL
- if [ "$CONFIG_CARDBUS" = "y" ]; then
- dep_tristate 'CardBus serial device support' CONFIG_PCMCIA_SERIAL_CB $CONFIG_PCMCIA_SERIAL
- fi
+dep_tristate 'PCMCIA serial device support' CONFIG_PCMCIA_SERIAL_CS $CONFIG_SERIAL
+if [ "$CONFIG_PCMCIA_SERIAL_CS" = "y" ]; then
+ define_bool CONFIG_PCMCIA_CHRDEV y
+fi
- if [ "$CONFIG_PCMCIA_SERIAL_CS" = "y" -o \
- "$CONFIG_PCMCIA_SERIAL_CB" = "y" ]; then
- define_bool CONFIG_PCMCIA_CHRDEV y
- fi
+endmenu
- endmenu
-fi
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/pcmcia/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 18:03:48 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 13:31:04 -0000 1.2
@@ -16,6 +16,5 @@
obj- :=
obj-$(CONFIG_PCMCIA_SERIAL_CS) += serial_cs.o
-obj-$(CONFIG_PCMCIA_SERIAL_CB) += serial_cb.o
include $(TOPDIR)/Rules.make
Index: serial_cs.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/char/pcmcia/serial_cs.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- serial_cs.c 25 Feb 2001 23:15:04 -0000 1.1.1.2
+++ serial_cs.c 11 Apr 2002 13:31:04 -0000 1.2
@@ -357,6 +357,7 @@
found_port:
if (i != CS_SUCCESS) {
+ printk(KERN_NOTICE "serial_cs: no usable port range found, giving up\n");
cs_error(link->handle, RequestIO, i);
return -1;
}
@@ -436,6 +437,7 @@
i = CardServices(RequestIRQ, link->handle, &link->irq);
if (i != CS_SUCCESS) {
+ printk(KERN_NOTICE "serial_cs: no usable port range found, giving up\n");
cs_error(link->handle, RequestIRQ, i);
link->irq.AssignedIRQ = 0;
}
@@ -661,3 +663,5 @@
module_init(init_serial_cs);
module_exit(exit_serial_cs);
+
+MODULE_LICENSE("GPL");
--- serial_cb.c DELETED ---
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:36:01
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox
In directory usw-pr-cvs1:/tmp/cvs-serv12946/video/matrox
Modified Files:
i2c-matroxfb.c matroxfb_DAC1064.c matroxfb_DAC1064.h
matroxfb_Ti3026.c matroxfb_accel.c matroxfb_base.c
matroxfb_base.h matroxfb_crtc2.c matroxfb_g450.c
matroxfb_g450.h matroxfb_maven.c matroxfb_misc.c
Log Message:
synch 2.4.15 commit 54
Index: i2c-matroxfb.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/i2c-matroxfb.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- i2c-matroxfb.c 14 Jan 2001 18:56:08 -0000 1.1.1.1
+++ i2c-matroxfb.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -1,3 +1,15 @@
+/*
+ *
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
+ *
+ * (c) 1998-2001 Petr Vandrovec <van...@vc...>
+ *
+ * Version: 1.51 2001/01/19
+ *
+ * See matroxfb_base.c for contributors.
+ *
+ */
+
#include "matroxfb_base.h"
#include "matroxfb_maven.h"
#include <linux/i2c.h>
@@ -282,8 +294,8 @@
return NULL;
matroxfb_DAC_lock_irqsave(flags);
- matroxfb_DAC_out(PMINFO DAC_XGENIODATA, 0x00);
- matroxfb_DAC_out(PMINFO DAC_XGENIOCTRL, 0xFF);
+ matroxfb_DAC_out(PMINFO DAC_XGENIODATA, 0xFF);
+ matroxfb_DAC_out(PMINFO DAC_XGENIOCTRL, 0x00);
matroxfb_DAC_unlock_irqrestore(flags);
memset(m2info, 0, sizeof(*m2info));
@@ -343,9 +355,10 @@
matroxfb_unregister_driver(&i2c_matroxfb);
}
-MODULE_AUTHOR("(c) 1999 Petr Vandrovec <van...@vc...>");
+MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <van...@vc...>");
MODULE_DESCRIPTION("Support module providing I2C buses present on Matrox videocards");
module_init(i2c_matroxfb_init);
module_exit(i2c_matroxfb_exit);
/* no __setup required */
+MODULE_LICENSE("GPL");
Index: matroxfb_DAC1064.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_DAC1064.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- matroxfb_DAC1064.c 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ matroxfb_DAC1064.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -4,7 +4,7 @@
*
* (c) 1998-2001 Petr Vandrovec <van...@vc...>
*
- * Version: 1.52 2001/02/02
+ * Version: 1.54 2001/09/09
*
* See matroxfb_base.c for contributors.
*
@@ -33,12 +33,14 @@
#define DAC1064_OPT_RESERVED 0x10
static void matroxfb_DAC1064_flashcursor(unsigned long ptr) {
+ unsigned long flags;
+
#define minfo ((struct matrox_fb_info*)ptr)
- matroxfb_DAC_lock();
+ matroxfb_DAC_lock_irqsave(flags);
outDAC1064(PMINFO M1064_XCURCTRL, inDAC1064(PMINFO M1064_XCURCTRL) ^ M1064_XCURCTRL_DIS ^ M1064_XCURCTRL_XGA);
ACCESS_FBINFO(cursor.timer.expires) = jiffies + HZ/2;
add_timer(&ACCESS_FBINFO(cursor.timer));
- matroxfb_DAC_unlock();
+ matroxfb_DAC_unlock_irqrestore(flags);
#undef minfo
}
@@ -317,9 +319,10 @@
outDAC1064(PMINFO M1064_XMISCCTRL, hw->DACreg[POS1064_XMISCCTRL]);
if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) {
outDAC1064(PMINFO 0x20, 0x04);
- outDAC1064(PMINFO 0x1F, 0x00);
+ outDAC1064(PMINFO 0x1F, ACCESS_FBINFO(devflags.dfp_type));
if (ACCESS_FBINFO(devflags.g450dac)) {
- outDAC1064(PMINFO M1064_X8B, 0xCC); /* only matrox know... */
+ outDAC1064(PMINFO M1064_XSYNCCTRL, 0xCC); /* only matrox know... */
+ outDAC1064(PMINFO M1064_XPWRCTRL, 0x1F); /* powerup everything */
outDAC1064(PMINFO M1064_XOUTPUTCONN, hw->DACreg[POS1064_XOUTPUTCONN]);
}
}
@@ -416,7 +419,12 @@
outDAC1064(PMINFO DAC1064_XSYSPLLM, hw->DACclk[3]);
outDAC1064(PMINFO DAC1064_XSYSPLLN, hw->DACclk[4]);
outDAC1064(PMINFO DAC1064_XSYSPLLP, hw->DACclk[5]);
- if (!oldhw || memcmp(hw->DACreg, oldhw->DACreg, sizeof(MGA1064_DAC_regs))) {
+ /*
+ * We must ALWAYS reprogram hardware due to broken XF4 matrox drivers...
+ *
+ * if (!oldhw || memcmp(hw->DACreg, oldhw->DACreg, sizeof(MGA1064_DAC_regs)))
+ */
+ {
unsigned int i;
for (i = 0; i < sizeof(MGA1064_DAC_regs); i++) {
@@ -714,7 +722,8 @@
ACCESS_FBINFO(capable.vxres) = vxres_g100;
ACCESS_FBINFO(features.accel.has_cacheflush) = 1;
ACCESS_FBINFO(cursor.timer.function) = matroxfb_DAC1064_flashcursor;
- ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) != FB_ACCEL_MATROX_MGAG100;
+ ACCESS_FBINFO(capable.plnwt) = ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG100
+ ? ACCESS_FBINFO(devflags.sgram) : 1;
ACCESS_FBINFO(primout) = &m1064;
@@ -843,6 +852,11 @@
}
}
DAC1064_setmclk(PMINFO hw, DAC1064_OPT_RESERVED | DAC1064_OPT_MDIV2 | DAC1064_OPT_GDIV1 | DAC1064_OPT_SCLK_PLL, 133333);
+ if (ACCESS_FBINFO(devflags.accelerator) == FB_ACCEL_MATROX_MGAG400) {
+ if (ACCESS_FBINFO(devflags.dfp_type) == -1) {
+ ACCESS_FBINFO(devflags.dfp_type) = inDAC1064(PMINFO 0x1F);
+ }
+ }
if (ACCESS_FBINFO(devflags.noinit))
return;
MGAG100_setPixClock(PMINFO 4, 25175);
@@ -921,3 +935,4 @@
EXPORT_SYMBOL(DAC1064_global_init);
EXPORT_SYMBOL(DAC1064_global_restore);
#endif
+MODULE_LICENSE("GPL");
Index: matroxfb_DAC1064.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_DAC1064.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_DAC1064.h 14 Jan 2001 18:56:13 -0000 1.1.1.1
+++ matroxfb_DAC1064.h 11 Apr 2002 13:26:54 -0000 1.2
@@ -138,11 +138,13 @@
#define M1064_XTVO_DATA 0x88
#define M1064_XOUTPUTCONN 0x8A
-#define M1064_X8B 0x8B
+#define M1064_XSYNCCTRL 0x8B
#define M1064_XPIXPLL2STAT 0x8C
#define M1064_XPIXPLL2P 0x8D
#define M1064_XPIXPLL2N 0x8E
#define M1064_XPIXPLL2M 0x8F
+
+#define M1064_XPWRCTRL 0xA0
enum POS1064 {
POS1064_XCURADDL=0, POS1064_XCURADDH, POS1064_XCURCTRL,
Index: matroxfb_Ti3026.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_Ti3026.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_Ti3026.c 14 Jan 2001 18:56:17 -0000 1.1.1.1
+++ matroxfb_Ti3026.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -279,12 +279,14 @@
0x00, 0x00, TVP3026_XCURCTRL_DIS };
static void matroxfb_ti3026_flashcursor(unsigned long ptr) {
+ unsigned long flags;
+
#define minfo ((struct matrox_fb_info*)ptr)
- matroxfb_DAC_lock();
+ matroxfb_DAC_lock_irqsave(flags);
outTi3026(PMINFO TVP3026_XCURCTRL, inTi3026(PMINFO TVP3026_XCURCTRL) ^ TVP3026_XCURCTRL_DIS ^ TVP3026_XCURCTRL_XGA);
ACCESS_FBINFO(cursor.timer.expires) = jiffies + HZ/2;
add_timer(&ACCESS_FBINFO(cursor.timer));
- matroxfb_DAC_unlock();
+ matroxfb_DAC_unlock_irqrestore(flags);
#undef minfo
}
@@ -861,3 +863,4 @@
};
EXPORT_SYMBOL(matrox_millennium);
#endif
+MODULE_LICENSE("GPL");
Index: matroxfb_accel.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_accel.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_accel.c 14 Jan 2001 18:56:22 -0000 1.1.1.1
+++ matroxfb_accel.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -2,9 +2,9 @@
*
* Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400
*
- * (c) 1998,1999,2000 Petr Vandrovec <van...@vc...>
+ * (c) 1998-2001 Petr Vandrovec <van...@vc...>
*
- * Version: 1.50 2000/08/10
+ * Version: 1.51 2001/06/18
*
* MTRR stuff: 1998 Tom Rini <tr...@ke...>
*
@@ -129,6 +129,10 @@
mga_outl(M_YDSTORG, curr_ydstorg(MINFO));
if (ACCESS_FBINFO(capable.plnwt))
mga_outl(M_PLNWT, -1);
+ if (ACCESS_FBINFO(capable.srcorg)) {
+ mga_outl(M_SRCORG, 0);
+ mga_outl(M_DSTORG, 0);
+ }
mga_outl(M_OPMODE, mopmode);
mga_outl(M_CXBNDRY, 0xFFFF0000);
mga_outl(M_YTOP, 0);
@@ -650,13 +654,15 @@
#ifdef FBCON_HAS_CFB8
static void matrox_cfb8_putcs(struct vc_data* conp, struct display* p, const unsigned short* s, int count, int yy, int xx) {
+ u_int16_t c;
u_int32_t fgx, bgx;
MINFO_FROM_DISP(p);
DBG_HEAVY("matroxfb_cfb8_putcs");
- fgx = attr_fgcol(p, scr_readw(s));
- bgx = attr_bgcol(p, scr_readw(s));
+ c = scr_readw(s);
+ fgx = attr_fgcol(p, c);
+ bgx = attr_bgcol(p, c);
fgx |= (fgx << 8);
fgx |= (fgx << 16);
bgx |= (bgx << 8);
@@ -667,13 +673,15 @@
#ifdef FBCON_HAS_CFB16
static void matrox_cfb16_putcs(struct vc_data* conp, struct display* p, const unsigned short* s, int count, int yy, int xx) {
+ u_int16_t c;
u_int32_t fgx, bgx;
MINFO_FROM_DISP(p);
DBG_HEAVY("matroxfb_cfb16_putcs");
- fgx = ((u_int16_t*)p->dispsw_data)[attr_fgcol(p, scr_readw(s))];
- bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol(p, scr_readw(s))];
+ c = scr_readw(s);
+ fgx = ((u_int16_t*)p->dispsw_data)[attr_fgcol(p, c)];
+ bgx = ((u_int16_t*)p->dispsw_data)[attr_bgcol(p, c)];
fgx |= (fgx << 16);
bgx |= (bgx << 16);
ACCESS_FBINFO(curr.putcs)(fgx, bgx, p, s, count, yy, xx);
@@ -682,13 +690,15 @@
#if defined(FBCON_HAS_CFB32) || defined(FBCON_HAS_CFB24)
static void matrox_cfb32_putcs(struct vc_data* conp, struct display* p, const unsigned short* s, int count, int yy, int xx) {
+ u_int16_t c;
u_int32_t fgx, bgx;
MINFO_FROM_DISP(p);
DBG_HEAVY("matroxfb_cfb32_putcs");
- fgx = ((u_int32_t*)p->dispsw_data)[attr_fgcol(p, scr_readw(s))];
- bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol(p, scr_readw(s))];
+ c = scr_readw(s);
+ fgx = ((u_int32_t*)p->dispsw_data)[attr_fgcol(p, c)];
+ bgx = ((u_int32_t*)p->dispsw_data)[attr_bgcol(p, c)];
ACCESS_FBINFO(curr.putcs)(fgx, bgx, p, s, count, yy, xx);
}
#endif
@@ -896,12 +906,14 @@
unsigned int offs;
unsigned int attr;
unsigned int step;
+ u_int16_t c;
CRITFLAGS
MINFO_FROM_DISP(p);
step = ACCESS_FBINFO(devflags.textstep);
offs = yy * p->next_line + xx * step;
- attr = attr_fgcol(p, scr_readw(s)) | (attr_bgcol(p, scr_readw(s)) << 4);
+ c = scr_readw(s);
+ attr = attr_fgcol(p, c) | (attr_bgcol(p, c) << 4);
CRITBEGIN
@@ -1233,3 +1245,4 @@
ACCESS_FBINFO(curr.putcs) = matrox_cfbX_putcs;
}
}
+MODULE_LICENSE("GPL");
Index: matroxfb_base.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_base.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- matroxfb_base.c 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ matroxfb_base.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -4,7 +4,7 @@
*
* (c) 1998-2001 Petr Vandrovec <van...@vc...>
*
- * Version: 1.52 2001/02/02
+ * Version: 1.54 2001/09/09
*
* MTRR stuff: 1998 Tom Rini <tr...@ke...>
*
@@ -72,6 +72,9 @@
* "Ken Aaker" <kd...@rc...>
* memtype extension (needed for GXT130P RS/6000 adapter)
*
+ * "Uns Lider" <uns...@mi...>
+ * G100 PLNWT fixes
+ *
* (following author is not in any relation with this code, but his code
* is included in this driver)
*
@@ -985,8 +988,6 @@
#undef minfo
}
-static int matroxfb_switch(int con, struct fb_info *info);
-
static int matroxfb_get_vblank(CPMINFO struct fb_vblank *vblank)
{
unsigned int sts1;
@@ -1180,7 +1181,7 @@
fb_ioctl: matroxfb_ioctl,
};
-static int matroxfb_switch(int con, struct fb_info *info)
+int matroxfb_switch(int con, struct fb_info *info)
{
#define minfo ((struct matrox_fb_info*)info)
struct fb_cmap* cmap;
@@ -1323,6 +1324,7 @@
static unsigned int fh; /* "matrox:fh:xxxxxk" */
static unsigned int maxclk; /* "matrox:maxclk:xxxxM" */
static int dfp; /* "matrox:dfp */
+static int dfp_type = -1; /* "matrox:dfp:xxx */
static int memtype = -1; /* "matrox:memtype:xxx" */
static char fontname[64]; /* "matrox:font:xxxxx" */
@@ -1409,12 +1411,12 @@
#define DEVF_VIDEO64BIT 0x0001
#define DEVF_SWAPS 0x0002
-/* #define DEVF_recycled 0x0004 */
-/* #define DEVF_recycled 0x0008 */
+#define DEVF_SRCORG 0x0004
+#define DEVF_BOTHDACS 0x0008 /* put CRTC1 on both outputs by default */
#define DEVF_CROSS4MB 0x0010
#define DEVF_TEXT4B 0x0020
#define DEVF_DDC_8_2 0x0040
-/* #define DEVF_recycled 0x0080 */
+#define DEVF_G550DAC 0x0080
#define DEVF_SUPPORT32MB 0x0100
#define DEVF_ANY_VXRES 0x0200
#define DEVF_TEXT16B 0x0400
@@ -1424,12 +1426,13 @@
#define DEVF_G450DAC 0x4000
#define DEVF_GCORE (DEVF_VIDEO64BIT | DEVF_SWAPS | DEVF_CROSS4MB | DEVF_DDC_8_2)
-#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE)
+#define DEVF_G2CORE (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_MAVEN_CAPABLE | DEVF_PANELLINK_CAPABLE | DEVF_SRCORG)
#define DEVF_G100 (DEVF_GCORE) /* no doc, no vxres... */
#define DEVF_G200 (DEVF_G2CORE)
#define DEVF_G400 (DEVF_G2CORE | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2)
/* if you'll find how to drive DFP... */
-#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC)
+#define DEVF_G450 (DEVF_GCORE | DEVF_ANY_VXRES | DEVF_SUPPORT32MB | DEVF_TEXT16B | DEVF_CRTC2 | DEVF_G450DAC | DEVF_SRCORG)
+#define DEVF_G550 (DEVF_G450 | DEVF_G550DAC | DEVF_BOTHDACS)
static struct board {
unsigned short vendor, device, rev, svid, sid;
@@ -1473,13 +1476,13 @@
"Mystique 220 (PCI)"},
#endif
#ifdef CONFIG_FB_MATROX_G100
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100, 0xFF,
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM, 0xFF,
PCI_SS_VENDOR_ID_MATROX, PCI_SS_ID_MATROX_MGA_G100_PCI,
DEVF_G100,
230000,
&vbG100,
"MGA-G100 (PCI)"},
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100, 0xFF,
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM, 0xFF,
0, 0,
DEVF_G100,
230000,
@@ -1556,25 +1559,31 @@
DEVF_G200,
230000,
&vbG200,
- "unknown G200 (AGP)"},
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, 0x80,
+ "G200 (AGP)"},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400, 0x80,
PCI_SS_VENDOR_ID_MATROX, PCI_SS_ID_MATROX_MILLENNIUM_G400_MAX_AGP,
DEVF_G400,
360000,
&vbG400,
"Millennium G400 MAX (AGP)"},
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, 0x80,
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400, 0x80,
0, 0,
DEVF_G400,
300000,
&vbG400,
- "unknown G400 (AGP)"},
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP, 0xFF,
+ "G400 (AGP)"},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400, 0xFF,
0, 0,
DEVF_G450,
500000, /* ??? vco goes up to 900MHz... */
&vbG400,
- "unknown G450 (AGP)"},
+ "G450"},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G550, 0xFF,
+ 0, 0,
+ DEVF_G550,
+ 500000,
+ &vbG400,
+ "G550"},
#endif
{0, 0, 0xFF,
0, 0,
@@ -1611,6 +1620,7 @@
printk(KERN_INFO "matroxfb: Matrox %s detected\n", b->name);
ACCESS_FBINFO(capable.plnwt) = 1;
+ ACCESS_FBINFO(capable.srcorg) = b->flags & DEVF_SRCORG;
ACCESS_FBINFO(devflags.video64bits) = b->flags & DEVF_VIDEO64BIT;
if (b->flags & DEVF_TEXT4B) {
ACCESS_FBINFO(devflags.vgastep) = 4;
@@ -1636,7 +1646,18 @@
if (dfp)
ACCESS_FBINFO(output.ph) |= MATROXFB_OUTPUT_CONN_DFP;
}
+ if (b->flags & DEVF_BOTHDACS) {
+#ifdef CONFIG_FB_MATROX_G450
+ ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY;
+ ACCESS_FBINFO(output.ph) |= MATROXFB_OUTPUT_CONN_SECONDARY;
+#else
+ printk(KERN_INFO "Only digital output of G550 is now working (in analog mode). Enable G450 support in\n");
+ printk(KERN_INFO "kernel configuration if you have analog monitor connected to G550 analog output.\n");
+#endif
+ }
+ ACCESS_FBINFO(devflags.dfp_type) = dfp_type;
ACCESS_FBINFO(devflags.g450dac) = b->flags & DEVF_G450DAC;
+ ACCESS_FBINFO(devflags.g550dac) = b->flags & DEVF_G550DAC;
ACCESS_FBINFO(devflags.textstep) = ACCESS_FBINFO(devflags.vgastep) * ACCESS_FBINFO(devflags.textmode);
ACCESS_FBINFO(devflags.textvram) = 65536 / ACCESS_FBINFO(devflags.textmode);
@@ -2054,7 +2075,7 @@
ACCESS_FBINFO(pcidev) = pdev;
ACCESS_FBINFO(dead) = 0;
ACCESS_FBINFO(usecount) = 0;
- pdev->driver_data = MINFO;
+ pci_set_drvdata(pdev, MINFO);
/* CMDLINE */
memcpy(ACCESS_FBINFO(fbcon.fontname), fontname, sizeof(ACCESS_FBINFO(fbcon.fontname)));
/* DEVFLAGS */
@@ -2116,7 +2137,7 @@
static void pci_remove_matrox(struct pci_dev* pdev) {
struct matrox_fb_info* minfo;
- minfo = pdev->driver_data;
+ minfo = pci_get_drvdata(pdev);
matroxfb_remove(PMINFO 1);
}
@@ -2134,7 +2155,7 @@
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
#endif
#ifdef CONFIG_FB_MATROX_G100
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100,
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_MM,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G100_AGP,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
@@ -2142,7 +2163,9 @@
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G200_AGP,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
- {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400_AGP,
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G400,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
+ {PCI_VENDOR_ID_MATROX, PCI_DEVICE_ID_MATROX_G550,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
#endif
{0, 0,
@@ -2151,6 +2174,7 @@
MODULE_DEVICE_TABLE(pci, matroxfb_devices);
+
static struct pci_driver matroxfb_driver = {
name: "matroxfb",
id_table: matroxfb_devices,
@@ -2348,7 +2372,7 @@
if (!options || !*options)
return 0;
- for(this_opt=strtok(options,","); this_opt; this_opt=strtok(NULL,",")) {
+ while ((this_opt = strsep(&options, ",")) != NULL) {
if (!*this_opt) continue;
dprintk("matroxfb_setup: option %s\n", this_opt);
@@ -2401,6 +2425,10 @@
mem = simple_strtoul(this_opt+4, NULL, 0);
else if (!strncmp(this_opt, "mode:", 5))
strncpy(videomode, this_opt+5, sizeof(videomode)-1);
+ else if (!strncmp(this_opt, "dfp:", 4)) {
+ dfp_type = simple_strtoul(this_opt+4, NULL, 0);
+ dfp = 1;
+ }
#ifdef CONFIG_PPC
else if (!strncmp(this_opt, "vmode:", 6)) {
unsigned int vmode = simple_strtoul(this_opt+6, NULL, 0);
@@ -2483,7 +2511,7 @@
return 0;
}
-static int __init initialized = 0;
+static int __initdata initialized = 0;
int __init matroxfb_init(void)
{
@@ -2495,6 +2523,7 @@
initialized = 1;
matrox_init();
}
+ hotplug = 1;
/* never return failure, user can hotplug matrox later... */
return 0;
}
@@ -2505,6 +2534,8 @@
MODULE_AUTHOR("(c) 1998-2001 Petr Vandrovec <van...@vc...>");
MODULE_DESCRIPTION("Accelerated FBDev driver for Matrox Millennium/Mystique/G100/G200/G400/G450");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(mem, "i");
MODULE_PARM_DESC(mem, "Size of available memory in MB, KB or B (2,4,8,12,16MB, default=autodetect)");
MODULE_PARM(disabled, "i");
@@ -2526,7 +2557,7 @@
MODULE_PARM(mtrr, "i");
MODULE_PARM_DESC(mtrr, "This speeds up video memory accesses (0=disabled or 1) (default=1)");
MODULE_PARM(sgram, "i");
-MODULE_PARM_DESC(sgram, "Indicates that G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)");
+MODULE_PARM_DESC(sgram, "Indicates that G100/G200/G400 has SGRAM memory (0=SDRAM, 1=SGRAM) (default=0)");
MODULE_PARM(inv24, "i");
MODULE_PARM_DESC(inv24, "Inverts clock polarity for 24bpp and loop frequency > 100MHz (default=do not invert polarity)");
MODULE_PARM(inverse, "i");
@@ -2581,6 +2612,8 @@
MODULE_PARM_DESC(cross4MB, "Specifies that 4MB boundary can be in middle of line. (default=autodetected)");
MODULE_PARM(dfp, "i");
MODULE_PARM_DESC(dfp, "Specifies whether to use digital flat panel interface of G200/G400 (0 or 1) (default=0)");
+MODULE_PARM(dfp_type, "i");
+MODULE_PARM_DESC(dfp_type, "Specifies DFP interface type (0 to 255) (default=read from hardware)");
#ifdef CONFIG_PPC
MODULE_PARM(vmode, "i");
MODULE_PARM_DESC(vmode, "Specify the vmode mode number that should be used (640x480 default)");
@@ -2622,6 +2655,7 @@
module_exit(matrox_done);
EXPORT_SYMBOL(matroxfb_register_driver);
EXPORT_SYMBOL(matroxfb_unregister_driver);
+EXPORT_SYMBOL(matroxfb_switch);
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
Index: matroxfb_base.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_base.h,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- matroxfb_base.h 25 Feb 2001 23:15:12 -0000 1.1.1.2
+++ matroxfb_base.h 11 Apr 2002 13:26:54 -0000 1.2
@@ -1,8 +1,8 @@
/*
*
- * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200 and G400
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450
*
- * (c) 1998,1999,2000 Petr Vandrovec <van...@vc...>
+ * (c) 1998,1999,2000,2001 Petr Vandrovec <van...@vc...>
*
*/
#ifndef __MATROXFB_H__
@@ -102,7 +102,7 @@
#endif /* MATROXFB_DEBUG */
-#ifndef __i386__
+#if !defined(__i386__) && !defined(__x86_64__)
#ifndef ioremap_nocache
#define ioremap_nocache(X,Y) ioremap(X,Y)
#endif
@@ -117,7 +117,7 @@
/* I benchmarked PII/350MHz with G200... MEMCPY, MEMCPYTOIO and WRITEL are on same speed ( <2% diff) */
/* so that means that G200 speed (or AGP speed?) is our limit... I do not have benchmark to test, how */
/* much of PCI bandwidth is used during transfers... */
-#if defined(__i386__)
+#if defined(__i386__) || defined(__x86_64__)
#define MEMCPYTOIO_MEMCPY
#else
#define MEMCPYTOIO_WRITEL
@@ -146,21 +146,6 @@
#ifndef PCI_SS_VENDOR_ID_MATROX
#define PCI_SS_VENDOR_ID_MATROX PCI_VENDOR_ID_MATROX
#endif
-#ifndef PCI_DEVICE_ID_MATROX_G200_PCI
-#define PCI_DEVICE_ID_MATROX_G200_PCI 0x0520
-#endif
-#ifndef PCI_DEVICE_ID_MATROX_G200_AGP
-#define PCI_DEVICE_ID_MATROX_G200_AGP 0x0521
-#endif
-#ifndef PCI_DEVICE_ID_MATROX_G100
-#define PCI_DEVICE_ID_MATROX_G100 0x1000
-#endif
-#ifndef PCI_DEVICE_ID_MATROX_G100_AGP
-#define PCI_DEVICE_ID_MATROX_G100_AGP 0x1001
-#endif
-#ifndef PCI_DEVICE_ID_MATROX_G400_AGP
-#define PCI_DEVICE_ID_MATROX_G400_AGP 0x0525
-#endif
#ifndef PCI_SS_ID_MATROX_PRODUCTIVA_G100_AGP
#define PCI_SS_ID_MATROX_GENERIC 0xFF00
@@ -492,6 +477,7 @@
int cross4MB;
int text;
int plnwt;
+ int srcorg;
} capable;
struct {
unsigned int size;
@@ -532,6 +518,8 @@
/* 0 except for 6MB Millenium */
int memtype;
int g450dac;
+ int g550dac;
+ int dfp_type;
} devflags;
struct display_switch dispsw;
struct {
@@ -738,6 +726,7 @@
/* G200 only */
#define M_SRCORG 0x2CB4
+#define M_DSTORG 0x2CB8
#define M_RAMDAC_BASE 0x3C00
Index: matroxfb_crtc2.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_crtc2.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_crtc2.c 14 Jan 2001 18:56:38 -0000 1.1.1.1
+++ matroxfb_crtc2.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -1,3 +1,13 @@
+/*
+ *
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
+ *
+ * (c) 1998-2001 Petr Vandrovec <van...@vc...>
+ *
+ * Version: 1.52 2001/05/25
+ *
+ */
+
#include "matroxfb_maven.h"
#include "matroxfb_crtc2.h"
#include "matroxfb_misc.h"
@@ -120,14 +130,31 @@
if (ACCESS_FBINFO(output.sh) & MATROXFB_OUTPUT_CONN_PRIMARY)
tmp |= 0x00100000; /* connect CRTC2 to DAC */
}
+ if (mt->interlaced) {
+ tmp |= 0x02000000; /* interlaced, second field is bigger, as G450 apparently ignores it */
+ mt->VDisplay >>= 1;
+ mt->VSyncStart >>= 1;
+ mt->VSyncEnd >>= 1;
+ mt->VTotal >>= 1;
+ }
mga_outl(0x3C10, tmp | 0x10000000); /* depth and so on... 0x10000000 is VIDRST polarity */
mga_outl(0x3C14, ((mt->HDisplay - 8) << 16) | (mt->HTotal - 8));
mga_outl(0x3C18, ((mt->HSyncEnd - 8) << 16) | (mt->HSyncStart - 8));
mga_outl(0x3C1C, ((mt->VDisplay - 1) << 16) | (mt->VTotal - 1));
mga_outl(0x3C20, ((mt->VSyncEnd - 1) << 16) | (mt->VSyncStart - 1));
mga_outl(0x3C24, ((mt->VSyncStart) << 16) | (mt->HSyncStart)); /* preload */
- mga_outl(0x3C28, pos); /* vmemory start */
- mga_outl(0x3C40, p->var.xres_virtual * (p->var.bits_per_pixel >> 3));
+ {
+ u_int32_t linelen = p->var.xres_virtual * (p->var.bits_per_pixel >> 3);
+ if (mt->interlaced) {
+ /* field #0 is smaller, so... */
+ mga_outl(0x3C2C, pos); /* field #1 vmemory start */
+ mga_outl(0x3C28, pos + linelen); /* field #0 vmemory start */
+ linelen <<= 1;
+ } else {
+ mga_outl(0x3C28, pos); /* vmemory start */
+ }
+ mga_outl(0x3C40, linelen);
+ }
tmp = 0x0FFF0000; /* line compare */
if (mt->sync & FB_SYNC_HOR_HIGH_ACT)
tmp |= 0x00000100;
@@ -145,11 +172,20 @@
static void matroxfb_dh_pan_var(struct matroxfb_dh_fb_info* m2info,
struct fb_var_screeninfo* var) {
unsigned int pos;
+ unsigned int linelen;
+ unsigned int pixelsize;
#define minfo (m2info->primary_dev)
- pos = (var->yoffset * var->xres_virtual + var->xoffset) * var->bits_per_pixel >> 3;
+ pixelsize = var->bits_per_pixel >> 3;
+ linelen = var->xres_virtual * pixelsize;
+ pos = var->yoffset * linelen + var->xoffset * pixelsize;
pos += m2info->video.offbase;
- mga_outl(0x3C28, pos);
+ if (var->vmode & FB_VMODE_INTERLACED) {
+ mga_outl(0x3C2C, pos);
+ mga_outl(0x3C28, pos + linelen);
+ } else {
+ mga_outl(0x3C28, pos);
+ }
#undef minfo
}
@@ -649,6 +685,9 @@
void* oldcrtc2;
d = kmalloc(sizeof(*d), GFP_KERNEL);
+ if (!d) {
+ return -ENOMEM;
+ }
memset(d, 0, sizeof(*d));
@@ -687,15 +726,13 @@
m2info->mmio.len = ACCESS_FBINFO(mmio.len);
/*
- * If we have two outputs, connect CRTC2 to it...
+ * If we have unused output, connect CRTC2 to it...
*/
- if (ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_SECONDARY) {
+ if ((ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_SECONDARY) &&
+ !(ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_SECONDARY) &&
+ !(ACCESS_FBINFO(output.ph) & MATROXFB_OUTPUT_CONN_DFP)) {
ACCESS_FBINFO(output.sh) |= MATROXFB_OUTPUT_CONN_SECONDARY;
- ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_SECONDARY;
- if (ACCESS_FBINFO(output.all) & MATROXFB_OUTPUT_CONN_DFP) {
- ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_DFP;
- ACCESS_FBINFO(output.ph) &= ~MATROXFB_OUTPUT_CONN_DFP;
- }
+ ACCESS_FBINFO(output.sh) &= ~MATROXFB_OUTPUT_CONN_DFP;
}
matroxfb_dh_set_var(&matroxfb_dh_defined, -2, &m2info->fbcon);
@@ -800,8 +837,9 @@
matroxfb_unregister_driver(&crtc2);
}
-MODULE_AUTHOR("(c) 1999,2000 Petr Vandrovec <van...@vc...>");
+MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <van...@vc...>");
MODULE_DESCRIPTION("Matrox G400 CRTC2 driver");
+MODULE_LICENSE("GPL");
module_init(matroxfb_crtc2_init);
module_exit(matroxfb_crtc2_exit);
/* we do not have __setup() yet */
Index: matroxfb_g450.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_g450.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_g450.c 14 Jan 2001 18:56:45 -0000 1.1.1.1
+++ matroxfb_g450.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -1,3 +1,15 @@
+/*
+ *
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
+ *
+ * (c) 1998-2001 Petr Vandrovec <van...@vc...>
+ *
+ * Version: 1.51 2001/01/19
+ *
+ * See matroxfb_base.c for contributors.
+ *
+ */
+
#include "matroxfb_g450.h"
#include "matroxfb_misc.h"
#include "matroxfb_DAC1064.h"
@@ -6,17 +18,20 @@
static int matroxfb_g450_get_reg(WPMINFO int reg) {
int val;
+ unsigned long flags;
- matroxfb_DAC_lock();
+ matroxfb_DAC_lock_irqsave(flags);
val = matroxfb_DAC_in(PMINFO reg);
- matroxfb_DAC_unlock();
+ matroxfb_DAC_unlock_irqrestore(flags);
return val;
}
static int matroxfb_g450_set_reg(WPMINFO int reg, int val) {
- matroxfb_DAC_lock();
+ unsigned long flags;
+
+ matroxfb_DAC_lock_irqsave(flags);
matroxfb_DAC_out(PMINFO reg, val);
- matroxfb_DAC_unlock();
+ matroxfb_DAC_unlock_irqrestore(flags);
return 0;
}
@@ -28,36 +43,53 @@
3
};
+static const struct matrox_pll_features g550_pll = {
+ 135000,
+ 27000,
+ 4, 127,
+ 0, 9,
+ 3
+};
+
static void DAC1064_calcclock(unsigned int freq, unsigned int fmax,
- unsigned int* in, unsigned int* feed, unsigned int* post) {
+ unsigned int* in, unsigned int* feed, unsigned int* post,
+ unsigned int timmings) {
unsigned int fvco;
unsigned int p;
- fvco = matroxfb_PLL_calcclock(&maven_pll, freq, fmax, in, feed, &p);
- /* 0 => 100 ... 275 MHz
- 1 => 243 ... 367 MHz
- 2 => 320 ... 475 MHz
- 3 => 453 ... 556 MHz
- 4 => 540 ... 594 MHz
- 5 => 588 ... 621 MHz
- 6 => 626 ... 637 MHz
- 7 => 631 ... 642 MHz
-
- As you can see, never choose frequency > 621 MHz, there is unavailable gap...
- Just to be sure, currently driver uses 110 ... 500 MHz range.
- */
- if (fvco <= 260000)
- ;
- else if (fvco <= 350000)
- p |= 0x08;
- else if (fvco <= 460000)
- p |= 0x10;
- else if (fvco <= 550000)
- p |= 0x18;
- else if (fvco <= 590000)
- p |= 0x20;
- else
- p |= 0x28;
+ switch (timmings) {
+ default:
+ fvco = matroxfb_PLL_calcclock(&maven_pll, freq, fmax, in, feed, &p);
+ /* 0 => 100 ... 275 MHz
+ 1 => 243 ... 367 MHz
+ 2 => 320 ... 475 MHz
+ 3 => 453 ... 556 MHz
+ 4 => 540 ... 594 MHz
+ 5 => 588 ... 621 MHz
+ 6 => 626 ... 637 MHz
+ 7 => 631 ... 642 MHz
+
+ As you can see, never choose frequency > 621 MHz, there is unavailable gap...
+ Just to be sure, currently driver uses 110 ... 500 MHz range.
+ */
+ if (fvco <= 260000)
+ ;
+ else if (fvco <= 350000)
+ p |= 0x08;
+ else if (fvco <= 460000)
+ p |= 0x10;
+ else if (fvco <= 550000)
+ p |= 0x18;
+ else if (fvco <= 590000)
+ p |= 0x20;
+ else
+ p |= 0x28;
+ break;
+ case 1:
+ fvco = matroxfb_PLL_calcclock(&g550_pll, freq, fmax, in, feed, &p);
+ /* p |= 0x00; */
+ break;
+ }
*post = p;
return;
}
@@ -67,7 +99,7 @@
struct mavenregs* m) {
unsigned int a, b, c;
- DAC1064_calcclock(mt->pixclock, 500000, &a, &b, &c);
+ DAC1064_calcclock(mt->pixclock, 300000, &a, &b, &c, m2info->timmings);
m->regs[0x80] = a;
m->regs[0x81] = b;
m->regs[0x82] = c;
@@ -136,6 +168,7 @@
ACCESS_FBINFO(altout.output) = &matroxfb_g450_altout;
up_write(&ACCESS_FBINFO(altout.lock));
ACCESS_FBINFO(output.all) |= MATROXFB_OUTPUT_CONN_SECONDARY;
+ matroxfb_switch(ACCESS_FBINFO(currcon), (struct fb_info*)MINFO);
return 0;
}
@@ -168,6 +201,11 @@
}
memset(m2info, 0, sizeof(*m2info));
m2info->primary_dev = MINFO;
+ if (ACCESS_FBINFO(devflags.g550dac)) {
+ m2info->timmings = 1;
+ } else {
+ m2info->timmings = 0;
+ }
if (matroxfb_g450_connect(m2info)) {
kfree(m2info);
printk(KERN_ERR "matroxfb_g450: G450 DAC failed to initialize\n");
@@ -195,7 +233,8 @@
matroxfb_unregister_driver(&g450);
}
-MODULE_AUTHOR("(c) 2000 Petr Vandrovec <van...@vc...>");
+MODULE_AUTHOR("(c) 2000-2001 Petr Vandrovec <van...@vc...>");
MODULE_DESCRIPTION("Matrox G450 secondary output driver");
+MODULE_LICENSE("GPL");
module_init(matroxfb_g450_init);
module_exit(matroxfb_g450_exit);
Index: matroxfb_g450.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_g450.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_g450.h 14 Jan 2001 18:56:45 -0000 1.1.1.1
+++ matroxfb_g450.h 11 Apr 2002 13:26:54 -0000 1.2
@@ -6,6 +6,7 @@
struct matroxfb_g450_info {
struct matrox_fb_info* primary_dev;
+ unsigned int timmings;
};
#endif /* __MATROXFB_MAVEN_H__ */
Index: matroxfb_maven.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_maven.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_maven.c 14 Jan 2001 18:56:42 -0000 1.1.1.1
+++ matroxfb_maven.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -1,3 +1,15 @@
+/*
+ *
+ * Hardware accelerated Matrox Millennium I, II, Mystique, G100, G200, G400 and G450.
+ *
+ * (c) 1998-2001 Petr Vandrovec <van...@vc...>
+ *
+ * Version: 1.51 2001/01/19
+ *
+ * See matroxfb_base.c for contributors.
+ *
+ */
+
#include "matroxfb_maven.h"
#include "matroxfb_misc.h"
#include "matroxfb_DAC1064.h"
@@ -1030,8 +1042,9 @@
i2c_del_driver(&maven_driver);
}
-MODULE_AUTHOR("(c) 1999,2000 Petr Vandrovec <van...@vc...>");
+MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <van...@vc...>");
MODULE_DESCRIPTION("Matrox G200/G400 Matrox MGA-TVO driver");
+MODULE_LICENSE("GPL");
module_init(matroxfb_maven_init);
module_exit(matroxfb_maven_exit);
/* we do not have __setup() yet */
Index: matroxfb_misc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/video/matrox/matroxfb_misc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- matroxfb_misc.c 14 Jan 2001 18:56:45 -0000 1.1.1.1
+++ matroxfb_misc.c 11 Apr 2002 13:26:54 -0000 1.2
@@ -4,7 +4,7 @@
*
* (c) 1998,1999,2000 Petr Vandrovec <van...@vc...>
*
- * Version: 1.50 2000/08/10
+ * Version: 1.54 2001/09/09
*
* MTRR stuff: 1998 Tom Rini <tr...@ke...>
*
@@ -63,6 +63,9 @@
* "Mark Vojkovich" <mvo...@uc...>
* G400 support
*
+ * "David C. Hansen" <hav...@us...>
+ * Fixes
+ *
* (following author is not in any relation with this code, but his code
* is included in this driver)
*
@@ -654,7 +657,7 @@
EXPORT_SYMBOL(matroxfb_fastfont_init); /* DAC1064, Ti3026 */
EXPORT_SYMBOL(matroxfb_vgaHWinit); /* DAC1064, Ti3026 */
EXPORT_SYMBOL(matroxfb_vgaHWrestore); /* DAC1064, Ti3026 */
-#ifdef MATROXFB_USE_SPINLOCK
-spinlock_t matroxfb_spinlock = SPIN_LOCK_UNLOCKED;
-EXPORT_SYMBOL(matroxfb_spinlock);
-#endif
+
+MODULE_AUTHOR("(c) 1999-2001 Petr Vandrovec <van...@vc...>");
+MODULE_DESCRIPTION("Miscellaneous support for Matrox video cards");
+MODULE_LICENSE("GPL");
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/irda
In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/irda
Modified Files:
Config.in Makefile actisys.c esi.c girbil.c irport.c irtty.c
litelink.c nsc-ircc.c old_belkin.c smc-ircc.c tekram.c
toshoboe.c w83977af_ir.c
Added Files:
ali-ircc.c ep7211_ir.c irda-usb.c sa1100_ir.c vlsi_ir.c
Log Message:
synch 2.4.15 commit 50
--- NEW FILE ---
/*********************************************************************
*
* Filename: ali-ircc.h
* Version: 0.5
* Description: Driver for the ALI M1535D and M1543C FIR Controller
* Status: Experimental.
* Author: Benjamin Kong <ben...@al...>
* Created at: 2000/10/16 03:46PM
* Modified at: 2001/1/3 02:55PM
* Modified by: Benjamin Kong <ben...@al...>
*
* Copyright (c) 2000 Benjamin Kong <ben...@al...>
* All Rights Reserved
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
[...2273 lines suppressed...]
MODULE_LICENSE("GPL");
MODULE_PARM(io, "1-4i");
MODULE_PARM_DESC(io, "Base I/O addresses");
MODULE_PARM(irq, "1-4i");
MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_PARM(dma, "1-4i");
MODULE_PARM_DESC(dma, "DMA channels");
int init_module(void)
{
return ali_ircc_init();
}
void cleanup_module(void)
{
ali_ircc_cleanup();
}
#endif /* MODULE */
--- NEW FILE ---
/*
* IR port driver for the Cirrus Logic EP7211 processor.
*
* Copyright 2001, Blue Mug Inc. All rights reserved.
*/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/tty.h>
#include <linux/sched.h>
#include <linux/init.h>
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/irda_device.h>
#include <asm/io.h>
#include <asm/hardware.h>
#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */
#define MAX_DELAY 10000 /* 1 ms */
static void ep7211_ir_open(dongle_t *self, struct qos_info *qos);
static void ep7211_ir_close(dongle_t *self);
static int ep7211_ir_change_speed(struct irda_task *task);
static int ep7211_ir_reset(struct irda_task *task);
static struct dongle_reg dongle = {
Q_NULL,
IRDA_EP7211_IR,
ep7211_ir_open,
ep7211_ir_close,
ep7211_ir_reset,
ep7211_ir_change_speed,
};
static void ep7211_ir_open(dongle_t *self, struct qos_info *qos)
{
unsigned int syscon1, flags;
save_flags(flags); cli();
/* Turn on the SIR encoder. */
syscon1 = clps_readl(SYSCON1);
syscon1 |= SYSCON1_SIREN;
clps_writel(syscon1, SYSCON1);
/* XXX: We should disable modem status interrupts on the first
UART (interrupt #14). */
restore_flags(flags);
MOD_INC_USE_COUNT;
}
static void ep7211_ir_close(dongle_t *self)
{
unsigned int syscon1, flags;
save_flags(flags); cli();
/* Turn off the SIR encoder. */
syscon1 = clps_readl(SYSCON1);
syscon1 &= ~SYSCON1_SIREN;
clps_writel(syscon1, SYSCON1);
/* XXX: If we've disabled the modem status interrupts, we should
reset them back to their original state. */
restore_flags(flags);
MOD_DEC_USE_COUNT;
}
/*
* Function ep7211_ir_change_speed (task)
*
* Change speed of the EP7211 I/R port. We don't really have to do anything
* for the EP7211 as long as the rate is being changed at the serial port
* level.
*/
static int ep7211_ir_change_speed(struct irda_task *task)
{
irda_task_next_state(task, IRDA_TASK_DONE);
return 0;
}
/*
* Function ep7211_ir_reset (task)
*
* Reset the EP7211 I/R. We don't really have to do anything.
*
*/
static int ep7211_ir_reset(struct irda_task *task)
{
irda_task_next_state(task, IRDA_TASK_DONE);
return 0;
}
/*
* Function ep7211_ir_init(void)
*
* Initialize EP7211 I/R module
*
*/
int __init ep7211_ir_init(void)
{
return irda_device_register_dongle(&dongle);
}
/*
* Function ep7211_ir_cleanup(void)
*
* Cleanup EP7211 I/R module
*
*/
static void __exit ep7211_ir_cleanup(void)
{
irda_device_unregister_dongle(&dongle);
}
MODULE_AUTHOR("Jon McClintock <jo...@bl...>");
MODULE_DESCRIPTION("EP7211 I/R driver");
MODULE_LICENSE("GPL");
#ifdef MODULE
module_init(ep7211_ir_init);
#endif /* MODULE */
module_exit(ep7211_ir_cleanup);
--- NEW FILE ---
/*****************************************************************************
*
* Filename: irda-usb.c
* Version: 0.9b
* Description: IrDA-USB Driver
* Status: Experimental
* Author: Dag Brattli <da...@br...>
*
* Copyright (C) 2000, Roman Weissgaerber <we...@vi...>
* Copyright (C) 2001, Dag Brattli <da...@br...>
* Copyright (C) 2001, Jean Tourrilhes <jt...@hp...>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
[...1545 lines suppressed...]
/* If the Device is zombie */
if((irda->usbdev != NULL) && (irda->present == 0)) {
IRDA_DEBUG(0, __FUNCTION__ "(), disconnect zombie now !\n");
irda_usb_disconnect(irda->usbdev, (void *) irda);
}
}
/* Deregister the driver and remove all pending instances */
usb_deregister(&irda_driver);
}
module_exit(usb_irda_cleanup);
/*------------------------------------------------------------------*/
/*
* Module parameters
*/
MODULE_PARM(qos_mtt_bits, "i");
MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
MODULE_AUTHOR("Roman Weissgaerber <we...@vi...>, Dag Brattli <da...@br...> and Jean Tourrilhes <jt...@hp...>");
MODULE_DESCRIPTION("IrDA-USB Dongle Driver");
--- NEW FILE ---
/*
* linux/drivers/net/irda/sa1100_ir.c
*
* Copyright (C) 2000-2001 Russell King
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*
* Infra-red driver for the StrongARM SA1100 embedded microprocessor
*
* Note that we don't have to worry about the SA1111's DMA bugs in here,
* so we use the straight forward pci_map_* functions with a null pointer.
* IMHO we should really be using our own machine specific set.
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/types.h>
#include <linux/init.h>
[...1124 lines suppressed...]
* We now know that the netdevice is no longer in use, and all
* references to our driver have been removed. The only structure
* which may still be present is the netdevice, which will get
* cleaned up by net/core/dev.c
*/
}
#ifdef MODULE
module_init(sa1100_irda_init);
module_exit(sa1100_irda_exit);
#endif
MODULE_AUTHOR("Russell King <rm...@ar...>");
MODULE_DESCRIPTION("StrongARM SA1100 IrDA driver");
MODULE_LICENSE("GPL");
MODULE_PARM(power_level, "i");
MODULE_PARM_DESC(power_level, "IrDA power level, 1 (low) to 3 (high)");
MODULE_PARM(tx_lpm, "i");
MODULE_PARM_DESC(tx_lpm, "Enable transmitter low power (1.6us) mode");
EXPORT_NO_SYMBOLS;
--- NEW FILE ---
/*********************************************************************
*
* vlsi_ir.c: VLSI82C147 PCI IrDA controller driver for Linux
*
* Version: 0.3, Sep 30, 2001
*
* Copyright (c) 2001 Martin Diehl
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
[...1298 lines suppressed...]
drivername, (i)?"rx":"tx", ringsize[i]);
printk(", using default=8\n");
ringsize[i] = 8;
break;
}
}
sirpulse = !!sirpulse;
return pci_module_init(&vlsi_irda_driver);
}
static void __exit vlsi_mod_exit(void)
{
pci_unregister_driver(&vlsi_irda_driver);
}
module_init(vlsi_mod_init);
module_exit(vlsi_mod_exit);
Index: Config.in
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/Config.in,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Config.in 14 Jan 2001 17:41:55 -0000 1.1.1.1
+++ Config.in 11 Apr 2002 12:37:48 -0000 1.2
@@ -5,14 +5,6 @@
dep_tristate 'IrTTY (uses Linux serial driver)' CONFIG_IRTTY_SIR $CONFIG_IRDA
dep_tristate 'IrPORT (IrDA serial driver)' CONFIG_IRPORT_SIR $CONFIG_IRDA
-comment 'FIR device drivers'
-dep_tristate 'NSC PC87108/PC87338' CONFIG_NSC_FIR $CONFIG_IRDA
-dep_tristate 'Winbond W83977AF (IR)' CONFIG_WINBOND_FIR $CONFIG_IRDA
-dep_tristate 'Toshiba Type-O IR Port' CONFIG_TOSHIBA_FIR $CONFIG_IRDA
-if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
-dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
-fi
-
comment 'Dongle support'
bool 'Serial dongle support' CONFIG_DONGLE
if [ "$CONFIG_DONGLE" != "n" ]; then
@@ -22,6 +14,23 @@
dep_tristate ' Greenwich GIrBIL dongle' CONFIG_GIRBIL_DONGLE $CONFIG_IRDA
dep_tristate ' Parallax LiteLink dongle' CONFIG_LITELINK_DONGLE $CONFIG_IRDA
dep_tristate ' Old Belkin dongle' CONFIG_OLD_BELKIN_DONGLE $CONFIG_IRDA
+ if [ "$CONFIG_ARCH_EP7211" = "y" ]; then
+ dep_tristate ' EP7211 I/R support' CONFIG_EP7211_IR $CONFIG_IRDA
+ fi
+fi
+
+comment 'FIR device drivers'
+dep_tristate 'IrDA USB dongles (Experimental)' CONFIG_USB_IRDA $CONFIG_IRDA $CONFIG_USB $CONFIG_EXPERIMENTAL
+dep_tristate 'NSC PC87108/PC87338' CONFIG_NSC_FIR $CONFIG_IRDA
+dep_tristate 'Winbond W83977AF (IR)' CONFIG_WINBOND_FIR $CONFIG_IRDA
+dep_tristate 'Toshiba Type-O IR Port' CONFIG_TOSHIBA_FIR $CONFIG_IRDA
+if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
+dep_tristate 'SMC IrCC (Experimental)' CONFIG_SMC_IRCC_FIR $CONFIG_IRDA
+dep_tristate 'ALi M5123 FIR (Experimental)' CONFIG_ALI_FIR $CONFIG_IRDA
+dep_tristate 'VLSI 82C147 SIR/MIR/FIR (Experimental)' CONFIG_VLSI_FIR $CONFIG_IRDA
+fi
+if [ "$CONFIG_ARCH_SA1100" = "y" ]; then
+ dep_tristate 'SA1100 Internal IR' CONFIG_SA1100_FIR $CONFIG_IRDA
fi
endmenu
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 17:41:55 -0000 1.1.1.1
+++ Makefile 11 Apr 2002 12:37:48 -0000 1.2
@@ -1,3 +1,4 @@
+# File: drivers/irda/Makefile
#
# Makefile for the Linux IrDA infrared port device drivers.
#
@@ -12,15 +13,20 @@
obj-$(CONFIG_IRTTY_SIR) += irtty.o
obj-$(CONFIG_IRPORT_SIR) += irport.o
+obj-$(CONFIG_USB_IRDA) += irda-usb.o
obj-$(CONFIG_NSC_FIR) += nsc-ircc.o
obj-$(CONFIG_WINBOND_FIR) += w83977af_ir.o
+obj-$(CONFIG_SA1100_FIR) += sa1100_ir.o
obj-$(CONFIG_TOSHIBA_FIR) += toshoboe.o
obj-$(CONFIG_SMC_IRCC_FIR) += smc-ircc.o irport.o
+obj-$(CONFIG_ALI_FIR) += ali-ircc.o
+obj-$(CONFIG_VLSI_FIR) += vlsi_ir.o
obj-$(CONFIG_ESI_DONGLE) += esi.o
obj-$(CONFIG_TEKRAM_DONGLE) += tekram.o
obj-$(CONFIG_ACTISYS_DONGLE) += actisys.o
obj-$(CONFIG_GIRBIL_DONGLE) += girbil.o
obj-$(CONFIG_LITELINK_DONGLE) += litelink.o
obj-$(CONFIG_OLD_BELKIN_DONGLE) += old_belkin.o
+obj-$(CONFIG_EP7211_IR) += ep7211_ir.o
include $(TOPDIR)/Rules.make
Index: actisys.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/actisys.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- actisys.c 14 Jan 2001 17:41:56 -0000 1.1.1.1
+++ actisys.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -272,6 +272,8 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...> - Jean Tourrilhes <jt...@hp...>");
MODULE_DESCRIPTION("ACTiSYS IR-220L and IR-220L+ dongle driver");
+MODULE_LICENSE("GPL");
+
/*
* Function init_module (void)
Index: esi.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/esi.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- esi.c 14 Jan 2001 17:41:56 -0000 1.1.1.1
+++ esi.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -136,6 +136,7 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Extended Systems JetEye PC dongle driver");
+MODULE_LICENSE("GPL");
/*
* Function init_module (void)
Index: girbil.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/girbil.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- girbil.c 14 Jan 2001 17:42:13 -0000 1.1.1.1
+++ girbil.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -234,6 +234,8 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Greenwich GIrBIL dongle driver");
+MODULE_LICENSE("GPL");
+
/*
* Function init_module (void)
Index: irport.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/irport.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- irport.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ irport.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -293,9 +293,9 @@
iobase = self->io.sir_base;
- spin_lock_irqsave(&self->lock, flags);
-
irport_stop(self);
+
+ spin_lock_irqsave(&self->lock, flags);
/* Initialize UART */
outb(UART_LCR_WLEN8, iobase+UART_LCR); /* Reset DLAB */
@@ -353,7 +353,7 @@
int lcr; /* Line control reg */
int divisor;
- IRDA_DEBUG(2, __FUNCTION__ "(), Setting speed to: %d\n", speed);
+ IRDA_DEBUG(0, __FUNCTION__ "(), Setting speed to: %d\n", speed);
ASSERT(self != NULL, return;);
@@ -609,14 +609,16 @@
*
* Transmits the current frame until FIFO is full, then
* waits until the next transmitt interrupt, and continues until the
- * frame is transmited.
+ * frame is transmitted.
*/
int irport_hard_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct irport_cb *self;
unsigned long flags;
int iobase;
- __s32 speed;
+ s32 speed;
+
+ IRDA_DEBUG(0, __FUNCTION__ "()\n");
ASSERT(dev != NULL, return 0;);
@@ -772,24 +774,33 @@
{
struct irport_cb *self;
int iobase;
+ char hwname[16];
+ IRDA_DEBUG(0, __FUNCTION__ "()\n");
+
ASSERT(dev != NULL, return -1;);
self = (struct irport_cb *) dev->priv;
iobase = self->io.sir_base;
if (request_irq(self->io.irq, self->interrupt, 0, dev->name,
- (void *) dev))
+ (void *) dev)) {
+ IRDA_DEBUG(0, __FUNCTION__ "(), unable to allocate irq=%d\n",
+ self->io.irq);
return -EAGAIN;
+ }
irport_start(self);
+ /* Give self a hardware name */
+ sprintf(hwname, "SIR @ 0x%03x", self->io.sir_base);
+
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
*/
- self->irlap = irlap_open(dev, &self->qos);
+ self->irlap = irlap_open(dev, &self->qos, hwname);
/* FIXME: change speed of dongle */
/* Ready to play! */
@@ -951,13 +962,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
- return -EPERM;
- irda_task_execute(self, __irport_change_speed, NULL, NULL,
- (void *) irq->ifr_baudrate);
+ ret = -EPERM;
+ else
+ irda_task_execute(self, __irport_change_speed, NULL,
+ NULL, (void *) irq->ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ break;
+ }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq->ifr_dongle);
if (!dongle)
@@ -978,16 +993,22 @@
NULL);
break;
case SIOCSMEDIABUSY: /* Set media busy */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ break;
+ }
+
irda_device_set_media_busy(self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq->ifr_receiving = irport_is_receiving(self);
break;
case SIOCSDTRRTS:
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ break;
+ }
+
irport_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
break;
default:
@@ -1008,12 +1029,14 @@
#ifdef MODULE
MODULE_PARM(io, "1-4i");
-MODULE_PARM_DESC(io, "Base I/O adresses");
+MODULE_PARM_DESC(io, "Base I/O addresses");
MODULE_PARM(irq, "1-4i");
MODULE_PARM_DESC(irq, "IRQ lines");
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Half duplex serial driver for IrDA SIR mode");
+MODULE_LICENSE("GPL");
+
void cleanup_module(void)
{
Index: irtty.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/irtty.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- irtty.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ irtty.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -824,7 +824,7 @@
/*
* Function irtty_raw_read (self, buf, len)
*
- * Receive incomming data. This function sleeps, so it must only be
+ * Receive incoming data. This function sleeps, so it must only be
* called with a process context. Timeout is currently defined to be
* a multiple of 10 ms.
*/
@@ -895,6 +895,8 @@
static int irtty_net_open(struct net_device *dev)
{
struct irtty_cb *self = (struct irtty_cb *) dev->priv;
+ struct tty_struct *tty = self->tty;
+ char hwname[16];
ASSERT(self != NULL, return -1;);
ASSERT(self->magic == IRTTY_MAGIC, return -1;);
@@ -907,11 +909,16 @@
/* Make sure we can receive more data */
irtty_stop_receiver(self, FALSE);
+ /* Give self a hardware name */
+ sprintf(hwname, "%s%d", tty->driver.name,
+ MINOR(tty->device) - tty->driver.minor_start +
+ tty->driver.name_base);
+
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
*/
- self->irlap = irlap_open(dev, &self->qos);
+ self->irlap = irlap_open(dev, &self->qos, hwname);
MOD_INC_USE_COUNT;
@@ -971,13 +978,17 @@
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
if (!capable(CAP_NET_ADMIN))
- return -EPERM;
- irda_task_execute(self, irtty_change_speed, NULL, NULL,
- (void *) irq->ifr_baudrate);
+ ret = -EPERM;
+ else
+ irda_task_execute(self, irtty_change_speed, NULL, NULL,
+ (void *) irq->ifr_baudrate);
break;
case SIOCSDONGLE: /* Set dongle */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ break;
+ }
+
/* Initialize dongle */
dongle = irda_device_dongle_init(dev, irq->ifr_dongle);
if (!dongle)
@@ -999,21 +1010,24 @@
break;
case SIOCSMEDIABUSY: /* Set media busy */
if (!capable(CAP_NET_ADMIN))
- return -EPERM;
- irda_device_set_media_busy(self->netdev, TRUE);
+ ret = -EPERM;
+ else
+ irda_device_set_media_busy(self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
irq->ifr_receiving = irtty_is_receiving(self);
break;
case SIOCSDTRRTS:
if (!capable(CAP_NET_ADMIN))
- return -EPERM;
- irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
+ ret = -EPERM;
+ else
+ irtty_set_dtr_rts(dev, irq->ifr_dtr, irq->ifr_rts);
break;
case SIOCSMODE:
if (!capable(CAP_NET_ADMIN))
- return -EPERM;
- irtty_set_mode(dev, irq->ifr_mode);
+ ret = -EPERM;
+ else
+ irtty_set_mode(dev, irq->ifr_mode);
break;
default:
ret = -EOPNOTSUPP;
@@ -1035,6 +1049,8 @@
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("IrDA TTY device driver");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(qos_mtt_bits, "i");
MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
Index: litelink.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/litelink.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- litelink.c 14 Jan 2001 17:42:13 -0000 1.1.1.1
+++ litelink.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -166,6 +166,8 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Parallax Litelink dongle driver");
+MODULE_LICENSE("GPL");
+
/*
* Function init_module (void)
Index: nsc-ircc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/nsc-ircc.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- nsc-ircc.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ nsc-ircc.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -90,7 +90,7 @@
static nsc_chip_t chips[] = {
{ "PC87108", { 0x150, 0x398, 0xea }, 0x05, 0x10, 0xf0,
nsc_ircc_probe_108, nsc_ircc_init_108 },
- { "PC87338", { 0x398, 0x15c, 0x2e }, 0x08, 0xb0, 0xf0,
+ { "PC87338", { 0x398, 0x15c, 0x2e }, 0x08, 0xb0, 0xf8,
nsc_ircc_probe_338, nsc_ircc_init_338 },
{ NULL }
};
@@ -112,7 +112,7 @@
"Reserved",
"Reserved",
"HP HSDL-1100/HSDL-2100",
- "HP HSDL-1100/HSDL-2100"
+ "HP HSDL-1100/HSDL-2100",
"Supports SIR Mode only",
"No dongle connected",
};
@@ -160,7 +160,7 @@
int i = 0;
/* Probe for all the NSC chipsets we know about */
- for (chip=chips; chip->name ; chip++,i++) {
+ for (chip=chips; chip->name ; chip++) {
IRDA_DEBUG(2, __FUNCTION__"(), Probing for %s ...\n",
chip->name);
@@ -196,7 +196,7 @@
* we init the chip, if not we probe the values
* set by the BIOS
*/
- if (io[i] < 2000) {
+ if (io[i] < 0x2000) {
chip->init(chip, &info);
} else
chip->probe(chip, &info);
@@ -251,9 +251,14 @@
IRDA_DEBUG(2, __FUNCTION__ "()\n");
+ MESSAGE("%s, Found chip at base=0x%03x\n", driver_name,
+ info->cfg_base);
+
if ((nsc_ircc_setup(info)) == -1)
return -1;
+ MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name);
+
/* Allocate new instance of the driver */
self = kmalloc(sizeof(struct nsc_ircc_cb), GFP_KERNEL);
if (self == NULL) {
@@ -315,8 +320,8 @@
self->tx_buff.head = (__u8 *) kmalloc(self->tx_buff.truesize,
GFP_KERNEL|GFP_DMA);
if (self->tx_buff.head == NULL) {
- kfree(self);
kfree(self->rx_buff.head);
+ kfree(self);
return -ENOMEM;
}
memset(self->tx_buff.head, 0, self->tx_buff.truesize);
@@ -597,7 +602,7 @@
outb(CFG_PNP0, cfg_base);
reg = inb(cfg_base+1);
- pnp = (reg >> 4) & 0x01;
+ pnp = (reg >> 3) & 0x01;
if (pnp) {
IRDA_DEBUG(2, "(), Chip is in PnP mode\n");
outb(0x46, cfg_base);
@@ -699,8 +704,6 @@
ERROR("%s, Wrong chip version %02x\n", driver_name, version);
return -1;
}
- MESSAGE("%s, Found chip at base=0x%03x\n", driver_name,
- info->cfg_base);
/* Switch to advanced mode */
switch_bank(iobase, BANK2);
@@ -729,8 +732,6 @@
outb(0x0d, iobase+2); /* Set SIR pulse width to 1.6us */
outb(0x2a, iobase+4); /* Set beginning frag, and preamble length */
- MESSAGE("%s, driver loaded (Dag Brattli)\n", driver_name);
-
/* Enable receive interrupts */
switch_bank(iobase, BANK0);
outb(IER_RXHDL_IE, iobase+IER);
@@ -1263,7 +1264,7 @@
* Function nsc_ircc_pio_xmit (self, iobase)
*
* Transmit data using PIO. Returns the number of bytes that actually
- * got transfered
+ * got transferred
*
*/
static int nsc_ircc_pio_write(int iobase, __u8 *buf, int len, int fifo_size)
@@ -1835,6 +1836,7 @@
{
struct nsc_ircc_cb *self;
int iobase;
+ char hwname[32];
__u8 bank;
IRDA_DEBUG(4, __FUNCTION__ "()\n");
@@ -1858,7 +1860,7 @@
if (request_dma(self->io.dma, dev->name)) {
WARNING("%s, unable to allocate dma=%d\n", driver_name,
self->io.dma);
- free_irq(self->io.irq, self);
+ free_irq(self->io.irq, dev);
return -EAGAIN;
}
@@ -1873,14 +1875,16 @@
outb(bank, iobase+BSR);
/* Ready to play! */
-
netif_start_queue(dev);
+ /* Give self a hardware name */
+ sprintf(hwname, "NSC-FIR @ 0x%03x", self->io.fir_base);
+
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
*/
- self->irlap = irlap_open(dev, &self->qos);
+ self->irlap = irlap_open(dev, &self->qos, hwname);
MOD_INC_USE_COUNT;
@@ -2008,18 +2012,10 @@
static void nsc_ircc_wakeup(struct nsc_ircc_cb *self)
{
- int iobase;
-
if (!self->io.suspended)
return;
- iobase = self->io.fir_base;
-
- /* Switch to advanced mode */
- switch_bank(iobase, BANK2);
- outb(ECR1_EXT_SL, iobase+ECR1);
- switch_bank(iobase, BANK0);
-
+ nsc_ircc_setup(&self->io);
nsc_ircc_net_open(self->netdev);
MESSAGE("%s, Waking up\n", driver_name);
@@ -2046,6 +2042,8 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("NSC IrDA Device Driver");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(qos_mtt_bits, "i");
MODULE_PARM_DESC(qos_mtt_bits, "Minimum Turn Time");
Index: old_belkin.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/old_belkin.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- old_belkin.c 14 Jan 2001 17:42:24 -0000 1.1.1.1
+++ old_belkin.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -152,6 +152,8 @@
#ifdef MODULE
MODULE_AUTHOR("Jean Tourrilhes <jt...@hp...>");
MODULE_DESCRIPTION("Belkin (old) SmartBeam dongle driver");
+MODULE_LICENSE("GPL");
+
/*
* Function init_module (void)
Index: smc-ircc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/smc-ircc.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- smc-ircc.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ smc-ircc.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -8,8 +8,11 @@
* Created at:
* Modified at: Tue Feb 22 10:05:06 2000
* Modified by: Dag Brattli <da...@br...>
+ * Modified at: Tue Jun 26 2001
+ * Modified by: Stefani Seibold <st...@se...>
*
- * Copyright (c) 1999-2000 Dag Brattli
+ * Copyright (c) 2001 Stefani Seibold
+ * Copyright (c) 1999-2001 Dag Brattli
* Copyright (c) 1998-1999 Thomas Davis,
* All Rights Reserved.
[...1156 lines suppressed...]
+
+module_init(smc_init);
+module_exit(smc_cleanup);
+
+MODULE_AUTHOR("Thomas Davis <ta...@jp...>");
+MODULE_DESCRIPTION("SMC IrCC controller driver");
+MODULE_LICENSE("GPL");
+
+MODULE_PARM(ircc_dma, "1i");
+MODULE_PARM_DESC(ircc_dma, "DMA channel");
+MODULE_PARM(ircc_irq, "1i");
+MODULE_PARM_DESC(ircc_irq, "IRQ line");
+MODULE_PARM(ircc_fir, "1-4i");
+MODULE_PARM_DESC(ircc_fir, "FIR Base Address");
+MODULE_PARM(ircc_sir, "1-4i");
+MODULE_PARM_DESC(ircc_sir, "SIR Base Address");
+MODULE_PARM(ircc_cfg, "1-4i");
+MODULE_PARM_DESC(ircc_cfg, "Configuration register base address");
#endif /* MODULE */
Index: tekram.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/tekram.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- tekram.c 14 Jan 2001 17:42:08 -0000 1.1.1.1
+++ tekram.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -267,6 +267,7 @@
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Tekram IrMate IR-210B dongle driver");
+MODULE_LICENSE("GPL");
/*
* Function init_module (void)
Index: toshoboe.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/toshoboe.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- toshoboe.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ toshoboe.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -43,9 +43,6 @@
/* Define this to enable FIR and MIR support */
#define ENABLE_FAST
-/* Number of ports this driver can support, you also need to edit dev_self below */
-#define NSELFS 4
-
/* Size of IO window */
#define CHIP_IO_EXTENT 0x1f
@@ -77,14 +74,19 @@
#include <net/irda/irda_device.h>
#include <linux/pm.h>
-static int toshoboe_pmproc (struct pm_dev *dev, pm_request_t rqst, void *data);
#include <net/irda/toshoboe.h>
-static char *driver_name = "toshoboe";
+#define PCI_DEVICE_ID_FIR701b 0x0d01
+
+static struct pci_device_id toshoboe_pci_tbl[] __initdata = {
+ { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701, PCI_ANY_ID, PCI_ANY_ID, },
+ { PCI_VENDOR_ID_TOSHIBA, PCI_DEVICE_ID_FIR701b, PCI_ANY_ID, PCI_ANY_ID, },
+ { } /* Terminating entry */
+};
+MODULE_DEVICE_TABLE(pci, toshoboe_pci_tbl);
-static struct toshoboe_cb *dev_self[NSELFS + 1] =
-{NULL, NULL, NULL, NULL, NULL};
+static const char *driver_name = "toshoboe";
static int max_baud = 4000000;
@@ -191,8 +193,8 @@
outb_p (OBOE_NTR_VAL, OBOE_NTR);
outb_p (0xf0, OBOE_REG_D);
outb_p (0xff, OBOE_ISR);
- outb_p (0x0f, OBOE_REG_1A);
- outb_p (0xff, OBOE_REG_1B);
+ outb_p (0x0f, OBOE_REG_1B);
+ outb_p (0xff, OBOE_REG_1A);
physaddr = virt_to_bus (self->taskfile);
@@ -508,6 +510,7 @@
toshoboe_net_open (struct net_device *dev)
{
struct toshoboe_cb *self;
+ char hwname[32];
IRDA_DEBUG (4, __FUNCTION__ "()\n");
@@ -535,11 +538,13 @@
/* Ready to play! */
netif_start_queue(dev);
+ /* Give self a hardware name */
+ sprintf(hwname, "Toshiba-FIR @ 0x%03x", self->base);
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
*/
- self->irlap = irlap_open(dev, &self->qos);
+ self->irlap = irlap_open(dev, &self->qos, hwname);
self->open = 1;
@@ -608,18 +613,21 @@
/* Disable interrupts & save flags */
save_flags(flags);
cli();
-
switch (cmd) {
case SIOCSBANDWIDTH: /* Set bandwidth */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ goto out;
+ }
/* toshoboe_setbaud(self, irq->ifr_baudrate); */
/* Just change speed once - inserted by Paul Bristow */
self->new_speed = irq->ifr_baudrate;
break;
case SIOCSMEDIABUSY: /* Set media busy */
- if (!capable(CAP_NET_ADMIN))
- return -EPERM;
+ if (!capable(CAP_NET_ADMIN)) {
+ ret = -EPERM;
+ goto out;
+ }
irda_device_set_media_busy(self->netdev, TRUE);
break;
case SIOCGRECEIVING: /* Check if we are receiving right now */
@@ -628,27 +636,27 @@
default:
ret = -EOPNOTSUPP;
}
-
+out:
restore_flags(flags);
-
return ret;
}
-#ifdef MODULE
-
MODULE_DESCRIPTION("Toshiba OBOE IrDA Device Driver");
MODULE_AUTHOR("James McKenzie <ja...@fi...>");
+MODULE_LICENSE("GPL");
+
MODULE_PARM (max_baud, "i");
MODULE_PARM_DESC(max_baus, "Maximum baud rate");
-static int
-toshoboe_close (struct toshoboe_cb *self)
+static void
+toshoboe_remove (struct pci_dev *pci_dev)
{
int i;
+ struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
IRDA_DEBUG (4, __FUNCTION__ "()\n");
- ASSERT (self != NULL, return -1;
+ ASSERT (self != NULL, return;
);
if (!self->stopped)
@@ -683,34 +691,23 @@
self->taskfilebuf = NULL;
self->taskfile = NULL;
- return (0);
+ return;
}
-#endif
-
-
-
static int
-toshoboe_open (struct pci_dev *pci_dev)
+toshoboe_probe (struct pci_dev *pci_dev, const struct pci_device_id *pdid)
{
struct toshoboe_cb *self;
struct net_device *dev;
- struct pm_dev *pmdev;
int i = 0;
int ok = 0;
int err;
IRDA_DEBUG (4, __FUNCTION__ "()\n");
- while (dev_self[i])
- i++;
-
- if (i == NSELFS)
- {
- printk (KERN_ERR "Oboe: No more instances available");
- return -ENOMEM;
- }
+ if ((err=pci_enable_device(pci_dev)))
+ return err;
self = kmalloc (sizeof (struct toshoboe_cb), GFP_KERNEL);
@@ -723,12 +720,10 @@
memset (self, 0, sizeof (struct toshoboe_cb));
- dev_self[i] = self; /*This needs moving if we ever get more than one chip */
-
self->open = 0;
self->stopped = 0;
self->pdev = pci_dev;
- self->base = pci_dev->resource[0].start;
+ self->base = pci_resource_start(pci_dev,0);
self->io.sir_base = self->base;
self->io.irq = pci_dev->irq;
@@ -736,19 +731,15 @@
self->io.speed = 9600;
/* Lock the port that we need */
- i = check_region (self->io.sir_base, self->io.sir_ext);
- if (i < 0)
+ if (NULL==request_region (self->io.sir_base, self->io.sir_ext, driver_name))
{
IRDA_DEBUG (0, __FUNCTION__ "(), can't get iobase of 0x%03x\n",
self->io.sir_base);
- dev_self[i] = NULL;
- kfree (self);
-
- return -ENODEV;
+ err = -EBUSY;
+ goto freeself;
}
-
irda_init_max_qos_capabilies (&self->qos);
self->qos.baud_rate.bits = 0;
@@ -791,8 +782,8 @@
if (!self->taskfilebuf)
{
printk (KERN_ERR "toshoboe: kmalloc for DMA failed()\n");
- kfree (self);
- return -ENOMEM;
+ err = -ENOMEM;
+ goto freeregion;
}
@@ -826,25 +817,16 @@
if (ok != RX_SLOTS + TX_SLOTS)
{
printk (KERN_ERR "toshoboe: kmalloc for buffers failed()\n");
+ err = -ENOMEM;
+ goto freebufs;
+ }
- for (i = 0; i < TX_SLOTS; ++i)
- if (self->xmit_bufs[i])
- kfree (self->xmit_bufs[i]);
- for (i = 0; i < RX_SLOTS; ++i)
- if (self->recv_bufs[i])
- kfree (self->recv_bufs[i]);
-
- kfree (self);
- return -ENOMEM;
-
- }
-
- request_region (self->io.sir_base, self->io.sir_ext, driver_name);
if (!(dev = dev_alloc("irda%d", &err))) {
- ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
- return -ENOMEM;
+ ERROR(__FUNCTION__ "(), dev_alloc() failed!\n");
+ err = -ENOMEM;
+ goto freebufs;
}
dev->priv = (void *) self;
self->netdev = dev;
@@ -862,12 +844,10 @@
rtnl_unlock();
if (err) {
ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
- return -1;
+ /* XXX there is not freeing for dev? */
+ goto freebufs;
}
-
- pmdev = pm_register (PM_PCI_DEV, PM_PCI_ID(pci_dev), toshoboe_pmproc);
- if (pmdev)
- pmdev->data = self;
+ pci_set_drvdata(pci_dev,self);
printk (KERN_WARNING "ToshOboe: Using ");
#ifdef ONETASK
@@ -878,48 +858,66 @@
printk (" tasks, version %s\n", rcsid);
return (0);
+freebufs:
+ for (i = 0; i < TX_SLOTS; ++i)
+ if (self->xmit_bufs[i])
+ kfree (self->xmit_bufs[i]);
+ for (i = 0; i < RX_SLOTS; ++i)
+ if (self->recv_bufs[i])
+ kfree (self->recv_bufs[i]);
+ kfree(self->taskfilebuf);
+freeregion:
+ release_region (self->io.sir_base, self->io.sir_ext);
+freeself:
+ kfree (self);
+ return err;
}
-static void
-toshoboe_gotosleep (struct toshoboe_cb *self)
+static int
+toshoboe_suspend (struct pci_dev *pci_dev, u32 crap)
{
int i = 10;
+ struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
printk (KERN_WARNING "ToshOboe: suspending\n");
- if (self->stopped)
- return;
+ if (!self || self->stopped)
+ return 0;
self->stopped = 1;
if (!self->open)
- return;
+ return 0;
/*FIXME: can't sleep here wait one second */
while ((i--) && (self->txpending))
- mdelay (100);
+ udelay (100);
toshoboe_stopchip (self);
toshoboe_disablebm (self);
self->txpending = 0;
-
+ return 0;
}
-static void
-toshoboe_wakeup (struct toshoboe_cb *self)
+static int
+toshoboe_resume (struct pci_dev *pci_dev)
{
+ struct toshoboe_cb *self = (struct toshoboe_cb*)pci_get_drvdata(pci_dev);
unsigned long flags;
+ if (!self)
+ return 0;
+
if (!self->stopped)
- return;
+ return 0;
if (!self->open)
{
self->stopped = 0;
- return;
+ return 0;
}
save_flags (flags);
@@ -936,90 +934,29 @@
netif_wake_queue(self->netdev);
restore_flags (flags);
printk (KERN_WARNING "ToshOboe: waking up\n");
-
-}
-
-static int
-toshoboe_pmproc (struct pm_dev *dev, pm_request_t rqst, void *data)
-{
- struct toshoboe_cb *self = (struct toshoboe_cb *) dev->data;
- if (self) {
- switch (rqst) {
- case PM_SUSPEND:
- toshoboe_gotosleep (self);
- break;
- case PM_RESUME:
- toshoboe_wakeup (self);
- break;
- }
- }
return 0;
}
+static struct pci_driver toshoboe_pci_driver = {
+ name : "toshoboe",
+ id_table : toshoboe_pci_tbl,
+ probe : toshoboe_probe,
+ remove : toshoboe_remove,
+ suspend : toshoboe_suspend,
+ resume : toshoboe_resume
+};
-int __init toshoboe_init (void)
-{
- struct pci_dev *pci_dev = NULL;
- int found = 0;
-
- do
- {
- pci_dev = pci_find_device (PCI_VENDOR_ID_TOSHIBA,
- PCI_DEVICE_ID_FIR701, pci_dev);
- if (pci_dev)
- {
- printk (KERN_WARNING "ToshOboe: Found 701 chip at 0x%0lx irq %d\n",
- pci_dev->resource[0].start,
- pci_dev->irq);
-
- if (!toshoboe_open (pci_dev))
- found++;
- }
-
- }
- while (pci_dev);
-
-
- if (found)
- {
- return 0;
- }
-
- return -ENODEV;
-}
-
-#ifdef MODULE
-
-static void
-toshoboe_cleanup (void)
-{
- int i;
-
- IRDA_DEBUG (4, __FUNCTION__ "()\n");
-
- for (i = 0; i < 4; i++)
- {
- if (dev_self[i])
- toshoboe_close (dev_self[i]);
- }
-
- pm_unregister_all (toshoboe_pmproc);
-}
-
-
-
-int
-init_module (void)
+int __init
+toshoboe_init (void)
{
- return toshoboe_init ();
+ return pci_module_init(&toshoboe_pci_driver);
}
-
void
-cleanup_module (void)
+toshoboe_cleanup (void)
{
- toshoboe_cleanup ();
+ pci_unregister_driver(&toshoboe_pci_driver);
}
-
-#endif
+module_init(toshoboe_init);
+module_exit(toshoboe_cleanup);
Index: w83977af_ir.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/irda/w83977af_ir.c,v
retrieving revision 1.1.1.2
retrieving revision 1.2
diff -u -r1.1.1.2 -r1.2
--- w83977af_ir.c 25 Feb 2001 23:15:01 -0000 1.1.1.2
+++ w83977af_ir.c 11 Apr 2002 12:37:48 -0000 1.2
@@ -875,7 +875,7 @@
self->stats.rx_fifo_errors++;
} else {
- /* Check if we have transfered all data to memory */
+ /* Check if we have transferred all data to memory */
switch_bank(iobase, SET0);
if (inb(iobase+USR) & USR_RDR) {
#ifdef CONFIG_USE_INTERNAL_TIMER
@@ -1210,6 +1210,7 @@
{
struct w83977af_ir *self;
int iobase;
+ char hwname[32];
__u8 set;
IRDA_DEBUG(0, __FUNCTION__ "()\n");
@@ -1251,11 +1252,14 @@
/* Ready to play! */
netif_start_queue(dev);
+ /* Give self a hardware name */
+ sprintf(hwname, "w83977af @ 0x%03x", self->io.fir_base);
+
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
*/
- self->irlap = irlap_open(dev, &self->qos);
+ self->irlap = irlap_open(dev, &self->qos, hwname);
MOD_INC_USE_COUNT;
@@ -1374,6 +1378,8 @@
MODULE_AUTHOR("Dag Brattli <da...@cs...>");
MODULE_DESCRIPTION("Winbond W83977AF IrDA Device Driver");
+MODULE_LICENSE("GPL");
+
MODULE_PARM(qos_mtt_bits, "i");
MODULE_PARM_DESC(qos_mtt_bits, "Mimimum Turn Time");
|
|
From: Andy P. <at...@us...> - 2002-04-11 14:35:54
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/h In directory usw-pr-cvs1:/tmp/cvs-serv30336/net/skfp/h Modified Files: skfbi.h smc.h Log Message: synch 2.4.15 commit 50 Index: skfbi.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/h/skfbi.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- skfbi.h 14 Jan 2001 17:41:40 -0000 1.1.1.1 +++ skfbi.h 11 Apr 2002 12:37:50 -0000 1.2 @@ -90,7 +90,7 @@ #define SKFDDI_PSZ 32 /* address PROM size */ /* - * address transmision from logical to physical offset address on board + * address transmission from logical to physical offset address on board */ #define FMA(a) (0x0400|((a)<<1)) /* FORMAC+ (r/w) */ #define P1A(a) (0x0800|((a)<<1)) /* PLC1 (r/w) */ @@ -347,7 +347,7 @@ #define SA_PMD_TYPE (8) /* start addr. PMD-Type */ /* - * address transmision from logical to physical offset address on board + * address transmission from logical to physical offset address on board */ #define FMA(a) (0x0100|((a)<<1)) /* FORMAC+ (r/w) */ #define P2(a) (0x00c0|((a)<<1)) /* PLC2 (r/w) (DAS) */ @@ -677,7 +677,7 @@ #ifdef ISA /* - * address transmision from logic NPADDR6-0 to physical offset address on board + * address transmission from logic NPADDR6-0 to physical offset address on board */ #define FMA(a) (0x8000|(((a)&0x07)<<1)|(((a)&0x78)<<7)) /* FORMAC+ (r/w) */ #define PRA(a) (0x1000|(((a)&0x07)<<1)|(((a)&0x18)<<7)) /* PROM (read only)*/ @@ -942,7 +942,7 @@ /* PCI_SUB_ID 16 bit Subsystem ID */ /* PCI_BASE_ROM 32 bit Expansion ROM Base Address */ -#define PCI_ROMBASE 0xfffe0000L /* Bit 31..17: ROM BASE addres (1st) */ +#define PCI_ROMBASE 0xfffe0000L /* Bit 31..17: ROM BASE address (1st) */ #define PCI_ROMBASZ 0x0001c000L /* Bit 16..14: Treat as BASE or SIZE */ #define PCI_ROMSIZE 0x00003800L /* Bit 13..11: ROM Size Requirements */ #define PCI_ROMEN 0x00000001L /* Bit 0: Address Decode enable */ @@ -1685,7 +1685,7 @@ #define PCI_PROG_INTFC 0x00 /* PCI programming Interface (=0) */ /* - * address transmision from logical to physical offset address on board + * address transmission from logical to physical offset address on board */ #define FMA(a) (0x0400|((a)<<2)) /* FORMAC+ (r/w) (SN3) */ #define P1(a) (0x0380|((a)<<2)) /* PLC1 (r/w) (DAS) */ Index: smc.h =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/net/skfp/h/smc.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -r1.1.1.1 -r1.2 --- smc.h 14 Jan 2001 17:41:43 -0000 1.1.1.1 +++ smc.h 11 Apr 2002 12:37:50 -0000 1.2 @@ -297,7 +297,7 @@ #define RS_NORINGOP (1<< 5) /* no ring op */ #define RS_VERSION (1<< 4) /* SMT version mismatch */ #define RS_STUCKBYPASSS (1<< 3) /* stuck bypass */ -#define RS_EVENT (1<< 2) /* FDDI event occured */ +#define RS_EVENT (1<< 2) /* FDDI event occurred */ #define RS_RINGOPCHANGE (1<< 1) /* ring op changed */ #define RS_RES0 (1<< 0) /* reserved */ |
|
From: Andy P. <at...@us...> - 2002-04-11 14:31:55
|
Update of /cvsroot/linux-vax/kernel-2.4/drivers/bluetooth
In directory usw-pr-cvs1:/tmp/cvs-serv26834/drivers/bluetooth
Added Files:
Config.in Makefile hci_uart.c hci_usb.c hci_vhci.c
Log Message:
synch 2.4.15 commit 56
--- NEW FILE ---
mainmenu_option next_comment
comment 'Bluetooth device drivers'
dep_tristate 'HCI USB driver' CONFIG_BLUEZ_HCIUSB $CONFIG_BLUEZ $CONFIG_USB
dep_tristate 'HCI UART driver' CONFIG_BLUEZ_HCIUART $CONFIG_BLUEZ
dep_tristate 'HCI VHCI virtual HCI device driver' CONFIG_BLUEZ_HCIVHCI $CONFIG_BLUEZ
endmenu
--- NEW FILE ---
#
# Makefile for Bluetooth HCI device drivers.
#
O_TARGET := bluetooth.o
obj-$(CONFIG_BLUEZ_HCIUSB) += hci_usb.o
obj-$(CONFIG_BLUEZ_HCIUART) += hci_uart.o
obj-$(CONFIG_BLUEZ_HCIVHCI) += hci_vhci.o
include $(TOPDIR)/Rules.make
--- NEW FILE ---
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (C) 2000-2001 Qualcomm Incorporated
Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
SOFTWARE IS DISCLAIMED.
*/
/*
* BlueZ HCI UART driver.
*
* $Id: hci_uart.c,v 1.1 2002/04/11 14:26:59 atp Exp $
*/
#define VERSION "1.0"
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/signal.h>
#include <linux/ioctl.h>
#include <linux/skbuff.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/bluez.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci_uart.h>
#ifndef HCI_UART_DEBUG
#undef DBG
#define DBG( A... )
#undef DMP
#define DMP( A... )
#endif
/* ------- Interface to HCI layer ------ */
/* Initialize device */
int n_hci_open(struct hci_dev *hdev)
{
DBG("%s %p", hdev->name, hdev);
/* Nothing to do for UART driver */
hdev->flags |= HCI_RUNNING;
return 0;
}
/* Reset device */
int n_hci_flush(struct hci_dev *hdev)
{
struct n_hci *n_hci = (struct n_hci *) hdev->driver_data;
struct tty_struct *tty = n_hci->tty;
DBG("hdev %p tty %p", hdev, tty);
/* Drop TX queue */
skb_queue_purge(&n_hci->txq);
/* Flush any pending characters in the driver and discipline. */
if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
return 0;
}
/* Close device */
int n_hci_close(struct hci_dev *hdev)
{
DBG("hdev %p", hdev);
hdev->flags &= ~HCI_RUNNING;
n_hci_flush(hdev);
return 0;
}
int n_hci_tx_wakeup(struct n_hci *n_hci)
{
register struct tty_struct *tty = n_hci->tty;
if (test_and_set_bit(TRANS_SENDING, &n_hci->tx_state)) {
set_bit(TRANS_WAKEUP, &n_hci->tx_state);
return 0;
}
DBG("");
do {
register struct sk_buff *skb;
register int len;
clear_bit(TRANS_WAKEUP, &n_hci->tx_state);
if (!(skb = skb_dequeue(&n_hci->txq)))
break;
DMP(skb->data, skb->len);
/* Send frame to TTY driver */
tty->flags |= (1 << TTY_DO_WRITE_WAKEUP);
len = tty->driver.write(tty, 0, skb->data, skb->len);
n_hci->hdev.stat.byte_tx += len;
DBG("sent %d", len);
if (len == skb->len) {
/* Full frame was sent */
kfree_skb(skb);
} else {
/* Subtract sent part and requeue */
skb_pull(skb, len);
skb_queue_head(&n_hci->txq, skb);
}
} while (test_bit(TRANS_WAKEUP, &n_hci->tx_state));
clear_bit(TRANS_SENDING, &n_hci->tx_state);
return 0;
}
/* Send frames from HCI layer */
int n_hci_send_frame(struct sk_buff *skb)
{
struct hci_dev* hdev = (struct hci_dev *) skb->dev;
struct tty_struct *tty;
struct n_hci *n_hci;
if (!hdev) {
ERR("Frame for uknown device (hdev=NULL)");
return -ENODEV;
}
if (!(hdev->flags & HCI_RUNNING))
return -EBUSY;
n_hci = (struct n_hci *) hdev->driver_data;
tty = n_hci2tty(n_hci);
DBG("%s: type %d len %d", hdev->name, skb->pkt_type, skb->len);
switch (skb->pkt_type) {
case HCI_COMMAND_PKT:
hdev->stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
hdev->stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
hdev->stat.cmd_tx++;
break;
};
/* Prepend skb with frame type and queue */
memcpy(skb_push(skb, 1), &skb->pkt_type, 1);
skb_queue_tail(&n_hci->txq, skb);
n_hci_tx_wakeup(n_hci);
return 0;
}
/* ------ LDISC part ------ */
/* n_hci_tty_open
*
* Called when line discipline changed to N_HCI.
*
* Arguments:
* tty pointer to tty info structure
* Return Value:
* 0 if success, otherwise error code
*/
static int n_hci_tty_open(struct tty_struct *tty)
{
struct n_hci *n_hci = tty2n_hci(tty);
struct hci_dev *hdev;
DBG("tty %p", tty);
if (n_hci)
return -EEXIST;
if (!(n_hci = kmalloc(sizeof(struct n_hci), GFP_KERNEL))) {
ERR("Can't allocate controll structure");
return -ENFILE;
}
memset(n_hci, 0, sizeof(struct n_hci));
/* Initialize and register HCI device */
hdev = &n_hci->hdev;
hdev->type = HCI_UART;
hdev->driver_data = n_hci;
hdev->open = n_hci_open;
hdev->close = n_hci_close;
hdev->flush = n_hci_flush;
hdev->send = n_hci_send_frame;
if (hci_register_dev(hdev) < 0) {
ERR("Can't register HCI device %s", hdev->name);
kfree(n_hci);
return -ENODEV;
}
tty->disc_data = n_hci;
n_hci->tty = tty;
spin_lock_init(&n_hci->rx_lock);
n_hci->rx_state = WAIT_PACKET_TYPE;
skb_queue_head_init(&n_hci->txq);
MOD_INC_USE_COUNT;
/* Flush any pending characters in the driver and discipline. */
if (tty->ldisc.flush_buffer)
tty->ldisc.flush_buffer(tty);
if (tty->driver.flush_buffer)
tty->driver.flush_buffer(tty);
return 0;
}
/* n_hci_tty_close()
*
* Called when the line discipline is changed to something
* else, the tty is closed, or the tty detects a hangup.
*/
static void n_hci_tty_close(struct tty_struct *tty)
{
struct n_hci *n_hci = tty2n_hci(tty);
struct hci_dev *hdev = &n_hci->hdev;
DBG("tty %p hdev %p", tty, hdev);
if (n_hci != NULL) {
n_hci_close(hdev);
if (hci_unregister_dev(hdev) < 0) {
ERR("Can't unregister HCI device %s",hdev->name);
}
hdev->driver_data = NULL;
tty->disc_data = NULL;
kfree(n_hci);
MOD_DEC_USE_COUNT;
}
}
/* n_hci_tty_wakeup()
*
* Callback for transmit wakeup. Called when low level
* device driver can accept more send data.
*
* Arguments: tty pointer to associated tty instance data
* Return Value: None
*/
static void n_hci_tty_wakeup( struct tty_struct *tty )
{
struct n_hci *n_hci = tty2n_hci(tty);
DBG("");
if (!n_hci)
return;
tty->flags &= ~(1 << TTY_DO_WRITE_WAKEUP);
if (tty != n_hci->tty)
return;
n_hci_tx_wakeup(n_hci);
}
/* n_hci_tty_room()
*
* Callback function from tty driver. Return the amount of
* space left in the receiver's buffer to decide if remote
* transmitter is to be throttled.
*
* Arguments: tty pointer to associated tty instance data
* Return Value: number of bytes left in receive buffer
*/
static int n_hci_tty_room (struct tty_struct *tty)
{
return 65536;
}
static inline int n_hci_check_data_len(struct n_hci *n_hci, int len)
{
register int room = skb_tailroom(n_hci->rx_skb);
DBG("len %d room %d", len, room);
if (!len) {
DMP(n_hci->rx_skb->data, n_hci->rx_skb->len);
hci_recv_frame(n_hci->rx_skb);
} else if (len > room) {
ERR("Data length is to large");
kfree_skb(n_hci->rx_skb);
n_hci->hdev.stat.err_rx++;
} else {
n_hci->rx_state = WAIT_DATA;
n_hci->rx_count = len;
return len;
}
n_hci->rx_state = WAIT_PACKET_TYPE;
n_hci->rx_skb = NULL;
n_hci->rx_count = 0;
return 0;
}
static inline void n_hci_rx(struct n_hci *n_hci, const __u8 * data, char *flags, int count)
{
register const char *ptr;
hci_event_hdr *eh;
hci_acl_hdr *ah;
hci_sco_hdr *sh;
register int len, type, dlen;
DBG("count %d state %ld rx_count %ld", count, n_hci->rx_state, n_hci->rx_count);
n_hci->hdev.stat.byte_rx += count;
ptr = data;
while (count) {
if (n_hci->rx_count) {
len = MIN(n_hci->rx_count, count);
memcpy(skb_put(n_hci->rx_skb, len), ptr, len);
n_hci->rx_count -= len; count -= len; ptr += len;
if (n_hci->rx_count)
continue;
switch (n_hci->rx_state) {
case WAIT_DATA:
DBG("Complete data");
DMP(n_hci->rx_skb->data, n_hci->rx_skb->len);
hci_recv_frame(n_hci->rx_skb);
n_hci->rx_state = WAIT_PACKET_TYPE;
n_hci->rx_skb = NULL;
continue;
case WAIT_EVENT_HDR:
eh = (hci_event_hdr *) n_hci->rx_skb->data;
DBG("Event header: evt 0x%2.2x plen %d", eh->evt, eh->plen);
n_hci_check_data_len(n_hci, eh->plen);
continue;
case WAIT_ACL_HDR:
ah = (hci_acl_hdr *) n_hci->rx_skb->data;
dlen = __le16_to_cpu(ah->dlen);
DBG("ACL header: dlen %d", dlen);
n_hci_check_data_len(n_hci, dlen);
continue;
case WAIT_SCO_HDR:
sh = (hci_sco_hdr *) n_hci->rx_skb->data;
DBG("SCO header: dlen %d", sh->dlen);
n_hci_check_data_len(n_hci, sh->dlen);
continue;
};
}
/* WAIT_PACKET_TYPE */
switch (*ptr) {
case HCI_EVENT_PKT:
DBG("Event packet");
n_hci->rx_state = WAIT_EVENT_HDR;
n_hci->rx_count = HCI_EVENT_HDR_SIZE;
type = HCI_EVENT_PKT;
break;
case HCI_ACLDATA_PKT:
DBG("ACL packet");
n_hci->rx_state = WAIT_ACL_HDR;
n_hci->rx_count = HCI_ACL_HDR_SIZE;
type = HCI_ACLDATA_PKT;
break;
case HCI_SCODATA_PKT:
DBG("SCO packet");
n_hci->rx_state = WAIT_SCO_HDR;
n_hci->rx_count = HCI_SCO_HDR_SIZE;
type = HCI_SCODATA_PKT;
break;
default:
ERR("Unknown HCI packet type %2.2x", (__u8)*ptr);
n_hci->hdev.stat.err_rx++;
ptr++; count--;
continue;
};
ptr++; count--;
/* Allocate packet */
if (!(n_hci->rx_skb = bluez_skb_alloc(HCI_MAX_FRAME_SIZE, GFP_ATOMIC))) {
ERR("Can't allocate mem for new packet");
n_hci->rx_state = WAIT_PACKET_TYPE;
n_hci->rx_count = 0;
return;
}
n_hci->rx_skb->dev = (void *) &n_hci->hdev;
n_hci->rx_skb->pkt_type = type;
}
}
/* n_hci_tty_receive()
*
* Called by tty low level driver when receive data is
* available.
*
* Arguments: tty pointer to tty isntance data
* data pointer to received data
* flags pointer to flags for data
* count count of received data in bytes
*
* Return Value: None
*/
static void n_hci_tty_receive(struct tty_struct *tty, const __u8 * data, char *flags, int count)
{
struct n_hci *n_hci = tty2n_hci(tty);
if (!n_hci || tty != n_hci->tty)
return;
spin_lock(&n_hci->rx_lock);
n_hci_rx(n_hci, data, flags, count);
spin_unlock(&n_hci->rx_lock);
if (test_and_clear_bit(TTY_THROTTLED,&tty->flags) && tty->driver.unthrottle)
tty->driver.unthrottle(tty);
}
/* n_hci_tty_ioctl()
*
* Process IOCTL system call for the tty device.
*
* Arguments:
*
* tty pointer to tty instance data
* file pointer to open file object for device
* cmd IOCTL command code
* arg argument for IOCTL call (cmd dependent)
*
* Return Value: Command dependent
*/
static int n_hci_tty_ioctl (struct tty_struct *tty, struct file * file,
unsigned int cmd, unsigned long arg)
{
struct n_hci *n_hci = tty2n_hci(tty);
int error = 0;
DBG("");
/* Verify the status of the device */
if (!n_hci)
return -EBADF;
switch (cmd) {
default:
error = n_tty_ioctl(tty, file, cmd, arg);
break;
};
return error;
}
/*
* We don't provide read/write/poll interface for user space.
*/
static ssize_t n_hci_tty_read(struct tty_struct *tty, struct file *file, unsigned char *buf, size_t nr)
{
return 0;
}
static ssize_t n_hci_tty_write(struct tty_struct *tty, struct file *file, const unsigned char *data, size_t count)
{
return 0;
}
static unsigned int n_hci_tty_poll(struct tty_struct *tty, struct file *filp, poll_table *wait)
{
return 0;
}
int __init n_hci_init(void)
{
static struct tty_ldisc n_hci_ldisc;
int err;
INF("BlueZ HCI UART driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION);
INF("Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>");
/* Register the tty discipline */
memset(&n_hci_ldisc, 0, sizeof (n_hci_ldisc));
n_hci_ldisc.magic = TTY_LDISC_MAGIC;
n_hci_ldisc.name = "n_hci";
n_hci_ldisc.open = n_hci_tty_open;
n_hci_ldisc.close = n_hci_tty_close;
n_hci_ldisc.read = n_hci_tty_read;
n_hci_ldisc.write = n_hci_tty_write;
n_hci_ldisc.ioctl = n_hci_tty_ioctl;
n_hci_ldisc.poll = n_hci_tty_poll;
n_hci_ldisc.receive_room= n_hci_tty_room;
n_hci_ldisc.receive_buf = n_hci_tty_receive;
n_hci_ldisc.write_wakeup= n_hci_tty_wakeup;
if ((err = tty_register_ldisc(N_HCI, &n_hci_ldisc))) {
ERR("Can't register HCI line discipline (%d)", err);
return err;
}
return 0;
}
void n_hci_cleanup(void)
{
int err;
/* Release tty registration of line discipline */
if ((err = tty_register_ldisc(N_HCI, NULL)))
ERR("Can't unregister HCI line discipline (%d)", err);
}
module_init(n_hci_init);
module_exit(n_hci_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <ma...@qu...>");
MODULE_DESCRIPTION("BlueZ HCI UART driver ver " VERSION);
MODULE_LICENSE("GPL");
--- NEW FILE ---
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (C) 2000-2001 Qualcomm Incorporated
Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
SOFTWARE IS DISCLAIMED.
*/
/*
* BlueZ HCI USB driver.
* Based on original USB Bluetooth driver for Linux kernel
* Copyright (c) 2000 Greg Kroah-Hartman <gr...@kr...>
* Copyright (c) 2000 Mark Douglas Corner <mc...@um...>
*
* $Id: hci_usb.c,v 1.1 2002/04/11 14:26:59 atp Exp $
*/
#define VERSION "1.0"
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/sched.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ptrace.h>
#include <linux/poll.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/signal.h>
#include <linux/ioctl.h>
#include <linux/skbuff.h>
#include <linux/usb.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/bluez.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci_usb.h>
#ifndef HCI_USB_DEBUG
#undef DBG
#define DBG( A... )
#undef DMP
#define DMP( A... )
#endif
static struct usb_device_id usb_bluetooth_ids [] = {
{ USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) },
{ } /* Terminating entry */
};
MODULE_DEVICE_TABLE (usb, usb_bluetooth_ids);
static int hci_usb_ctrl_msg(struct hci_usb *husb, struct sk_buff *skb);
static int hci_usb_write_msg(struct hci_usb *husb, struct sk_buff *skb);
static void hci_usb_unlink_urbs(struct hci_usb *husb)
{
usb_unlink_urb(husb->read_urb);
usb_unlink_urb(husb->intr_urb);
usb_unlink_urb(husb->ctrl_urb);
usb_unlink_urb(husb->write_urb);
}
static void hci_usb_free_bufs(struct hci_usb *husb)
{
if (husb->read_urb) {
if (husb->read_urb->transfer_buffer)
kfree(husb->read_urb->transfer_buffer);
usb_free_urb(husb->read_urb);
}
if (husb->intr_urb) {
if (husb->intr_urb->transfer_buffer)
kfree(husb->intr_urb->transfer_buffer);
usb_free_urb(husb->intr_urb);
}
if (husb->ctrl_urb)
usb_free_urb(husb->ctrl_urb);
if (husb->write_urb)
usb_free_urb(husb->write_urb);
if (husb->intr_skb)
kfree_skb(husb->intr_skb);
}
/* ------- Interface to HCI layer ------ */
/* Initialize device */
int hci_usb_open(struct hci_dev *hdev)
{
struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
int status;
DBG("%s", hdev->name);
husb->read_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->read_urb)))
DBG("read submit failed. %d", status);
husb->intr_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->intr_urb)))
DBG("interrupt submit failed. %d", status);
hdev->flags |= HCI_RUNNING;
return 0;
}
/* Reset device */
int hci_usb_flush(struct hci_dev *hdev)
{
struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
DBG("%s", hdev->name);
/* Drop TX queues */
skb_queue_purge(&husb->tx_ctrl_q);
skb_queue_purge(&husb->tx_write_q);
return 0;
}
/* Close device */
int hci_usb_close(struct hci_dev *hdev)
{
struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
DBG("%s", hdev->name);
hdev->flags &= ~HCI_RUNNING;
hci_usb_unlink_urbs(husb);
hci_usb_flush(hdev);
return 0;
}
void hci_usb_ctrl_wakeup(struct hci_usb *husb)
{
struct sk_buff *skb;
if (test_and_set_bit(HCI_TX_CTRL, &husb->tx_state))
return;
DBG("%s", husb->hdev.name);
if (!(skb = skb_dequeue(&husb->tx_ctrl_q)))
goto done;
if (hci_usb_ctrl_msg(husb, skb)){
kfree_skb(skb);
goto done;
}
DMP(skb->data, skb->len);
husb->hdev.stat.byte_tx += skb->len;
return;
done:
clear_bit(HCI_TX_CTRL, &husb->tx_state);
return;
}
void hci_usb_write_wakeup(struct hci_usb *husb)
{
struct sk_buff *skb;
if (test_and_set_bit(HCI_TX_WRITE, &husb->tx_state))
return;
DBG("%s", husb->hdev.name);
if (!(skb = skb_dequeue(&husb->tx_write_q)))
goto done;
if (hci_usb_write_msg(husb, skb)) {
skb_queue_head(&husb->tx_write_q, skb);
goto done;
}
DMP(skb->data, skb->len);
husb->hdev.stat.byte_tx += skb->len;
return;
done:
clear_bit(HCI_TX_WRITE, &husb->tx_state);
return;
}
/* Send frames from HCI layer */
int hci_usb_send_frame(struct sk_buff *skb)
{
struct hci_dev *hdev = (struct hci_dev *) skb->dev;
struct hci_usb *husb;
if (!hdev) {
ERR("frame for uknown device (hdev=NULL)");
return -ENODEV;
}
if (!(hdev->flags & HCI_RUNNING))
return 0;
husb = (struct hci_usb *) hdev->driver_data;
DBG("%s type %d len %d", hdev->name, skb->pkt_type, skb->len);
switch (skb->pkt_type) {
case HCI_COMMAND_PKT:
skb_queue_tail(&husb->tx_ctrl_q, skb);
hci_usb_ctrl_wakeup(husb);
hdev->stat.cmd_tx++;
return 0;
case HCI_ACLDATA_PKT:
skb_queue_tail(&husb->tx_write_q, skb);
hci_usb_write_wakeup(husb);
hdev->stat.acl_tx++;
return 0;
case HCI_SCODATA_PKT:
return -EOPNOTSUPP;
};
return 0;
}
/* ---------- USB ------------- */
static void hci_usb_ctrl(struct urb *urb)
{
struct sk_buff *skb = (struct sk_buff *) urb->context;
struct hci_dev *hdev;
struct hci_usb *husb;
if (!skb)
return;
hdev = (struct hci_dev *) skb->dev;
husb = (struct hci_usb *) hdev->driver_data;
DBG("%s", hdev->name);
if (urb->status)
DBG("%s ctrl status: %d", hdev->name, urb->status);
clear_bit(HCI_TX_CTRL, &husb->tx_state);
kfree_skb(skb);
/* Wake up device */
hci_usb_ctrl_wakeup(husb);
}
static void hci_usb_bulk_write(struct urb *urb)
{
struct sk_buff *skb = (struct sk_buff *) urb->context;
struct hci_dev *hdev;
struct hci_usb *husb;
if (!skb)
return;
hdev = (struct hci_dev *) skb->dev;
husb = (struct hci_usb *) hdev->driver_data;
DBG("%s", hdev->name);
if (urb->status)
DBG("%s bulk write status: %d", hdev->name, urb->status);
clear_bit(HCI_TX_WRITE, &husb->tx_state);
kfree_skb(skb);
/* Wake up device */
hci_usb_write_wakeup(husb);
return;
}
static void hci_usb_intr(struct urb *urb)
{
struct hci_usb *husb = (struct hci_usb *) urb->context;
unsigned char *data = urb->transfer_buffer;
register int count = urb->actual_length;
register struct sk_buff *skb = husb->intr_skb;
hci_event_hdr *eh;
register int len;
if (!husb)
return;
DBG("%s count %d", husb->hdev.name, count);
if (urb->status || !count) {
DBG("%s intr status %d, count %d", husb->hdev.name, urb->status, count);
return;
}
/* Do we really have to handle continuations here ? */
if (!skb) {
/* New frame */
if (count < HCI_EVENT_HDR_SIZE) {
DBG("%s bad frame len %d", husb->hdev.name, count);
return;
}
eh = (hci_event_hdr *) data;
len = eh->plen + HCI_EVENT_HDR_SIZE;
if (count > len) {
DBG("%s corrupted frame, len %d", husb->hdev.name, count);
return;
}
/* Allocate skb */
if (!(skb = bluez_skb_alloc(len, GFP_ATOMIC))) {
ERR("Can't allocate mem for new packet");
return;
}
skb->dev = (void *) &husb->hdev;
skb->pkt_type = HCI_EVENT_PKT;
husb->intr_skb = skb;
husb->intr_count = len;
} else {
/* Continuation */
if (count > husb->intr_count) {
ERR("%s bad frame len %d (expected %d)", husb->hdev.name, count, husb->intr_count);
kfree_skb(skb);
husb->intr_skb = NULL;
husb->intr_count = 0;
return;
}
}
memcpy(skb_put(skb, count), data, count);
husb->intr_count -= count;
DMP(data, count);
if (!husb->intr_count) {
/* Got complete frame */
husb->hdev.stat.byte_rx += skb->len;
hci_recv_frame(skb);
husb->intr_skb = NULL;
}
}
static void hci_usb_bulk_read(struct urb *urb)
{
struct hci_usb *husb = (struct hci_usb *) urb->context;
unsigned char *data = urb->transfer_buffer;
int count = urb->actual_length, status;
struct sk_buff *skb;
hci_acl_hdr *ah;
register __u16 dlen;
if (!husb)
return;
DBG("%s status %d, count %d, flags %x", husb->hdev.name, urb->status, count, urb->transfer_flags);
if (urb->status) {
/* Do not re-submit URB on critical errors */
switch (urb->status) {
case -ENOENT:
return;
default:
goto resubmit;
};
}
if (!count)
goto resubmit;
DMP(data, count);
ah = (hci_acl_hdr *) data;
dlen = le16_to_cpu(ah->dlen);
/* Verify frame len and completeness */
if ((count - HCI_ACL_HDR_SIZE) != dlen) {
ERR("%s corrupted ACL packet: count %d, plen %d", husb->hdev.name, count, dlen);
goto resubmit;
}
/* Allocate packet */
if (!(skb = bluez_skb_alloc(count, GFP_ATOMIC))) {
ERR("Can't allocate mem for new packet");
goto resubmit;
}
memcpy(skb_put(skb, count), data, count);
skb->dev = (void *) &husb->hdev;
skb->pkt_type = HCI_ACLDATA_PKT;
husb->hdev.stat.byte_rx += skb->len;
hci_recv_frame(skb);
resubmit:
husb->read_urb->dev = husb->udev;
if ((status = usb_submit_urb(husb->read_urb)))
DBG("%s read URB submit failed %d", husb->hdev.name, status);
DBG("%s read URB re-submited", husb->hdev.name);
}
static int hci_usb_ctrl_msg(struct hci_usb *husb, struct sk_buff *skb)
{
struct urb *urb = husb->ctrl_urb;
devrequest *dr = &husb->dev_req;
int pipe, status;
DBG("%s len %d", husb->hdev.name, skb->len);
pipe = usb_sndctrlpipe(husb->udev, 0);
dr->requesttype = HCI_CTRL_REQ;
dr->request = 0;
dr->index = 0;
dr->value = 0;
dr->length = cpu_to_le16(skb->len);
FILL_CONTROL_URB(urb, husb->udev, pipe, (void*)dr, skb->data, skb->len,
hci_usb_ctrl, skb);
if ((status = usb_submit_urb(urb))) {
DBG("%s control URB submit failed %d", husb->hdev.name, status);
return status;
}
return 0;
}
static int hci_usb_write_msg(struct hci_usb *husb, struct sk_buff *skb)
{
struct urb *urb = husb->write_urb;
int pipe, status;
DBG("%s len %d", husb->hdev.name, skb->len);
pipe = usb_sndbulkpipe(husb->udev, husb->bulk_out_ep_addr);
FILL_BULK_URB(urb, husb->udev, pipe, skb->data, skb->len,
hci_usb_bulk_write, skb);
urb->transfer_flags |= USB_QUEUE_BULK;
if ((status = usb_submit_urb(urb))) {
DBG("%s write URB submit failed %d", husb->hdev.name, status);
return status;
}
return 0;
}
static void * hci_usb_probe(struct usb_device *udev, unsigned int ifnum, const struct usb_device_id *id)
{
struct usb_endpoint_descriptor *bulk_out_ep, *intr_in_ep, *bulk_in_ep;
struct usb_interface_descriptor *uif;
struct usb_endpoint_descriptor *ep;
struct hci_usb *husb;
struct hci_dev *hdev;
int i, size, pipe;
__u8 * buf;
DBG("udev %p ifnum %d", udev, ifnum);
/* Check device signature */
if ((udev->descriptor.bDeviceClass != HCI_DEV_CLASS) ||
(udev->descriptor.bDeviceSubClass != HCI_DEV_SUBCLASS)||
(udev->descriptor.bDeviceProtocol != HCI_DEV_PROTOCOL) )
return NULL;
MOD_INC_USE_COUNT;
uif = &udev->actconfig->interface[ifnum].altsetting[0];
if (uif->bNumEndpoints != 3) {
DBG("Wrong number of endpoints %d", uif->bNumEndpoints);
MOD_DEC_USE_COUNT;
return NULL;
}
bulk_out_ep = intr_in_ep = bulk_in_ep = NULL;
/* Find endpoints that we need */
for ( i = 0; i < uif->bNumEndpoints; ++i) {
ep = &uif->endpoint[i];
switch (ep->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
case USB_ENDPOINT_XFER_BULK:
if (ep->bEndpointAddress & USB_DIR_IN)
bulk_in_ep = ep;
else
bulk_out_ep = ep;
break;
case USB_ENDPOINT_XFER_INT:
intr_in_ep = ep;
break;
};
}
if (!bulk_in_ep || !bulk_out_ep || !intr_in_ep) {
DBG("Endpoints not found: %p %p %p", bulk_in_ep, bulk_out_ep, intr_in_ep);
MOD_DEC_USE_COUNT;
return NULL;
}
if (!(husb = kmalloc(sizeof(struct hci_usb), GFP_KERNEL))) {
ERR("Can't allocate: control structure");
MOD_DEC_USE_COUNT;
return NULL;
}
memset(husb, 0, sizeof(struct hci_usb));
husb->udev = udev;
husb->bulk_out_ep_addr = bulk_out_ep->bEndpointAddress;
if (!(husb->ctrl_urb = usb_alloc_urb(0))) {
ERR("Can't allocate: control URB");
goto probe_error;
}
if (!(husb->write_urb = usb_alloc_urb(0))) {
ERR("Can't allocate: write URB");
goto probe_error;
}
if (!(husb->read_urb = usb_alloc_urb(0))) {
ERR("Can't allocate: read URB");
goto probe_error;
}
ep = bulk_in_ep;
pipe = usb_rcvbulkpipe(udev, ep->bEndpointAddress);
size = HCI_MAX_FRAME_SIZE;
if (!(buf = kmalloc(size, GFP_KERNEL))) {
ERR("Can't allocate: read buffer");
goto probe_error;
}
FILL_BULK_URB(husb->read_urb, udev, pipe, buf, size, hci_usb_bulk_read, husb);
husb->read_urb->transfer_flags |= USB_QUEUE_BULK;
ep = intr_in_ep;
pipe = usb_rcvintpipe(udev, ep->bEndpointAddress);
size = usb_maxpacket(udev, pipe, usb_pipeout(pipe));
if (!(husb->intr_urb = usb_alloc_urb(0))) {
ERR("Can't allocate: interrupt URB");
goto probe_error;
}
if (!(buf = kmalloc(size, GFP_KERNEL))) {
ERR("Can't allocate: interrupt buffer");
goto probe_error;
}
FILL_INT_URB(husb->intr_urb, udev, pipe, buf, size, hci_usb_intr, husb, ep->bInterval);
skb_queue_head_init(&husb->tx_ctrl_q);
skb_queue_head_init(&husb->tx_write_q);
/* Initialize and register HCI device */
hdev = &husb->hdev;
hdev->type = HCI_USB;
hdev->driver_data = husb;
hdev->open = hci_usb_open;
hdev->close = hci_usb_close;
hdev->flush = hci_usb_flush;
hdev->send = hci_usb_send_frame;
if (hci_register_dev(hdev) < 0) {
ERR("Can't register HCI device %s", hdev->name);
goto probe_error;
}
return husb;
probe_error:
hci_usb_free_bufs(husb);
kfree(husb);
MOD_DEC_USE_COUNT;
return NULL;
}
static void hci_usb_disconnect(struct usb_device *udev, void *ptr)
{
struct hci_usb *husb = (struct hci_usb *) ptr;
struct hci_dev *hdev = &husb->hdev;
if (!husb)
return;
DBG("%s", hdev->name);
hci_usb_close(hdev);
if (hci_unregister_dev(hdev) < 0) {
ERR("Can't unregister HCI device %s", hdev->name);
}
hci_usb_free_bufs(husb);
kfree(husb);
MOD_DEC_USE_COUNT;
}
static struct usb_driver hci_usb_driver =
{
name: "hci_usb",
probe: hci_usb_probe,
disconnect: hci_usb_disconnect,
id_table: usb_bluetooth_ids,
};
int hci_usb_init(void)
{
int err;
INF("BlueZ HCI USB driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION);
INF("Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>");
if ((err = usb_register(&hci_usb_driver)) < 0)
ERR("Failed to register HCI USB driver");
return err;
}
void hci_usb_cleanup(void)
{
usb_deregister(&hci_usb_driver);
}
module_init(hci_usb_init);
module_exit(hci_usb_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <ma...@qu...>");
MODULE_DESCRIPTION("BlueZ HCI USB driver ver " VERSION);
MODULE_LICENSE("GPL");
--- NEW FILE ---
/*
BlueZ - Bluetooth protocol stack for Linux
Copyright (C) 2000-2001 Qualcomm Incorporated
Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation;
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
SOFTWARE IS DISCLAIMED.
*/
/*
* BlueZ HCI virtual device driver.
*
* $Id: hci_vhci.c,v 1.1 2002/04/11 14:26:59 atp Exp $
*/
#define VERSION "1.0"
#include <linux/config.h>
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/major.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/fcntl.h>
#include <linux/init.h>
#include <linux/random.h>
#include <linux/skbuff.h>
#include <linux/miscdevice.h>
#include <asm/system.h>
#include <asm/uaccess.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/bluez.h>
#include <net/bluetooth/hci_core.h>
#include <net/bluetooth/hci_vhci.h>
/* HCI device part */
int hci_vhci_open(struct hci_dev *hdev)
{
hdev->flags |= HCI_RUNNING;
return 0;
}
int hci_vhci_flush(struct hci_dev *hdev)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) hdev->driver_data;
skb_queue_purge(&hci_vhci->readq);
return 0;
}
int hci_vhci_close(struct hci_dev *hdev)
{
hdev->flags &= ~HCI_RUNNING;
hci_vhci_flush(hdev);
return 0;
}
int hci_vhci_send_frame(struct sk_buff *skb)
{
struct hci_dev* hdev = (struct hci_dev *) skb->dev;
struct hci_vhci_struct *hci_vhci;
if (!hdev) {
ERR("Frame for uknown device (hdev=NULL)");
return -ENODEV;
}
if (!(hdev->flags & HCI_RUNNING))
return -EBUSY;
hci_vhci = (struct hci_vhci_struct *) hdev->driver_data;
memcpy(skb_push(skb, 1), &skb->pkt_type, 1);
skb_queue_tail(&hci_vhci->readq, skb);
if (hci_vhci->flags & VHCI_FASYNC)
kill_fasync(&hci_vhci->fasync, SIGIO, POLL_IN);
wake_up_interruptible(&hci_vhci->read_wait);
return 0;
}
/* Character device part */
/* Poll */
static unsigned int hci_vhci_chr_poll(struct file *file, poll_table * wait)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
poll_wait(file, &hci_vhci->read_wait, wait);
if (skb_queue_len(&hci_vhci->readq))
return POLLIN | POLLRDNORM;
return POLLOUT | POLLWRNORM;
}
/* Get packet from user space buffer(already verified) */
static inline ssize_t hci_vhci_get_user(struct hci_vhci_struct *hci_vhci, const char *buf, size_t count)
{
struct sk_buff *skb;
if (count > HCI_MAX_FRAME_SIZE)
return -EINVAL;
if (!(skb = bluez_skb_alloc(count, GFP_KERNEL)))
return -ENOMEM;
copy_from_user(skb_put(skb, count), buf, count);
skb->dev = (void *) &hci_vhci->hdev;
skb->pkt_type = *((__u8 *) skb->data);
skb_pull(skb, 1);
hci_recv_frame(skb);
return count;
}
/* Write */
static ssize_t hci_vhci_chr_write(struct file * file, const char * buf,
size_t count, loff_t *pos)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
if (verify_area(VERIFY_READ, buf, count))
return -EFAULT;
return hci_vhci_get_user(hci_vhci, buf, count);
}
/* Put packet to user space buffer(already verified) */
static inline ssize_t hci_vhci_put_user(struct hci_vhci_struct *hci_vhci,
struct sk_buff *skb, char *buf, int count)
{
int len = count, total = 0;
char *ptr = buf;
len = MIN(skb->len, len);
copy_to_user(ptr, skb->data, len);
total += len;
hci_vhci->hdev.stat.byte_tx += len;
switch (skb->pkt_type) {
case HCI_COMMAND_PKT:
hci_vhci->hdev.stat.cmd_tx++;
break;
case HCI_ACLDATA_PKT:
hci_vhci->hdev.stat.acl_tx++;
break;
case HCI_SCODATA_PKT:
hci_vhci->hdev.stat.cmd_tx++;
break;
};
return total;
}
/* Read */
static ssize_t hci_vhci_chr_read(struct file * file, char * buf, size_t count, loff_t *pos)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
DECLARE_WAITQUEUE(wait, current);
struct sk_buff *skb;
ssize_t ret = 0;
add_wait_queue(&hci_vhci->read_wait, &wait);
while (count) {
current->state = TASK_INTERRUPTIBLE;
/* Read frames from device queue */
if (!(skb = skb_dequeue(&hci_vhci->readq))) {
if (file->f_flags & O_NONBLOCK) {
ret = -EAGAIN;
break;
}
if (signal_pending(current)) {
ret = -ERESTARTSYS;
break;
}
/* Nothing to read, let's sleep */
schedule();
continue;
}
if (!verify_area(VERIFY_WRITE, buf, count))
ret = hci_vhci_put_user(hci_vhci, skb, buf, count);
else
ret = -EFAULT;
kfree_skb(skb);
break;
}
current->state = TASK_RUNNING;
remove_wait_queue(&hci_vhci->read_wait, &wait);
return ret;
}
static loff_t hci_vhci_chr_lseek(struct file * file, loff_t offset, int origin)
{
return -ESPIPE;
}
static int hci_vhci_chr_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
{
return -EINVAL;
}
static int hci_vhci_chr_fasync(int fd, struct file *file, int on)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
int ret;
if ((ret = fasync_helper(fd, file, on, &hci_vhci->fasync)) < 0)
return ret;
if (on)
hci_vhci->flags |= VHCI_FASYNC;
else
hci_vhci->flags &= ~VHCI_FASYNC;
return 0;
}
static int hci_vhci_chr_open(struct inode *inode, struct file * file)
{
struct hci_vhci_struct *hci_vhci = NULL;
struct hci_dev *hdev;
if (!(hci_vhci = kmalloc(sizeof(struct hci_vhci_struct), GFP_KERNEL)))
return -ENOMEM;
memset(hci_vhci, 0, sizeof(struct hci_vhci_struct));
skb_queue_head_init(&hci_vhci->readq);
init_waitqueue_head(&hci_vhci->read_wait);
/* Initialize and register HCI device */
hdev = &hci_vhci->hdev;
hdev->type = HCI_VHCI;
hdev->driver_data = hci_vhci;
hdev->open = hci_vhci_open;
hdev->close = hci_vhci_close;
hdev->flush = hci_vhci_flush;
hdev->send = hci_vhci_send_frame;
if (hci_register_dev(hdev) < 0) {
kfree(hci_vhci);
return -EBUSY;
}
file->private_data = hci_vhci;
return 0;
}
static int hci_vhci_chr_close(struct inode *inode, struct file *file)
{
struct hci_vhci_struct *hci_vhci = (struct hci_vhci_struct *) file->private_data;
if (hci_unregister_dev(&hci_vhci->hdev) < 0) {
ERR("Can't unregister HCI device %s", hci_vhci->hdev.name);
}
kfree(hci_vhci);
file->private_data = NULL;
return 0;
}
static struct file_operations hci_vhci_fops = {
owner: THIS_MODULE,
llseek: hci_vhci_chr_lseek,
read: hci_vhci_chr_read,
write: hci_vhci_chr_write,
poll: hci_vhci_chr_poll,
ioctl: hci_vhci_chr_ioctl,
open: hci_vhci_chr_open,
release:hci_vhci_chr_close,
fasync: hci_vhci_chr_fasync
};
static struct miscdevice hci_vhci_miscdev=
{
VHCI_MINOR,
"hci_vhci",
&hci_vhci_fops
};
int __init hci_vhci_init(void)
{
INF("BlueZ VHCI driver ver %s Copyright (C) 2000,2001 Qualcomm Inc",
VERSION);
INF("Written 2000,2001 by Maxim Krasnyansky <ma...@qu...>");
if (misc_register(&hci_vhci_miscdev)) {
ERR("Can't register misc device %d\n", VHCI_MINOR);
return -EIO;
}
return 0;
}
void hci_vhci_cleanup(void)
{
misc_deregister(&hci_vhci_miscdev);
}
module_init(hci_vhci_init);
module_exit(hci_vhci_cleanup);
MODULE_AUTHOR("Maxim Krasnyansky <ma...@qu...>");
MODULE_DESCRIPTION("BlueZ VHCI driver ver " VERSION);
MODULE_LICENSE("GPL");
|