diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-06-28 00:46:22 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-28 00:46:22 -0400 |
commit | c36ad397a30fcf9369d82584324cc24189eb6b1c (patch) | |
tree | a5cbb451a2e9ea3ea12b6d279c72d77ac96c3028 /include | |
parent | c903e41e67046e7f52bbc404bd5aa654d12540cc (diff) | |
parent | 99f95e5286df2f69edab8a04c7080d986ee4233b (diff) | |
download | blackbird-op-linux-c36ad397a30fcf9369d82584324cc24189eb6b1c.tar.gz blackbird-op-linux-c36ad397a30fcf9369d82584324cc24189eb6b1c.zip |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-i386/ide.h | 12 | ||||
-rw-r--r-- | include/asm-sparc64/auxio.h | 2 | ||||
-rw-r--r-- | include/asm-sparc64/floppy.h | 16 | ||||
-rw-r--r-- | include/asm-sparc64/irq.h | 7 | ||||
-rw-r--r-- | include/asm-sparc64/rwsem.h | 3 | ||||
-rw-r--r-- | include/asm-sparc64/spinlock.h | 29 | ||||
-rw-r--r-- | include/asm-sparc64/spitfire.h | 1 | ||||
-rw-r--r-- | include/linux/mod_devicetable.h | 46 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 2 | ||||
-rw-r--r-- | include/pcmcia/ciscode.h | 2 | ||||
-rw-r--r-- | include/pcmcia/cs.h | 2 | ||||
-rw-r--r-- | include/pcmcia/device_id.h | 249 | ||||
-rw-r--r-- | include/pcmcia/ds.h | 9 | ||||
-rw-r--r-- | include/pcmcia/ss.h | 34 |
14 files changed, 375 insertions, 39 deletions
diff --git a/include/asm-i386/ide.h b/include/asm-i386/ide.h index 859ebf4da632..79dfab87135d 100644 --- a/include/asm-i386/ide.h +++ b/include/asm-i386/ide.h @@ -41,13 +41,17 @@ static __inline__ int ide_default_irq(unsigned long base) static __inline__ unsigned long ide_default_io_base(int index) { + if (pci_find_device(PCI_ANY_ID, PCI_ANY_ID, NULL) == NULL) { + switch(index) { + case 2: return 0x1e8; + case 3: return 0x168; + case 4: return 0x1e0; + case 5: return 0x160; + } + } switch (index) { case 0: return 0x1f0; case 1: return 0x170; - case 2: return 0x1e8; - case 3: return 0x168; - case 4: return 0x1e0; - case 5: return 0x160; default: return 0; } diff --git a/include/asm-sparc64/auxio.h b/include/asm-sparc64/auxio.h index 5eb01dd47150..81a590a50a1f 100644 --- a/include/asm-sparc64/auxio.h +++ b/include/asm-sparc64/auxio.h @@ -75,6 +75,8 @@ #ifndef __ASSEMBLY__ +extern void __iomem *auxio_register; + #define AUXIO_LTE_ON 1 #define AUXIO_LTE_OFF 0 diff --git a/include/asm-sparc64/floppy.h b/include/asm-sparc64/floppy.h index e071b4b4edfd..49d49a285943 100644 --- a/include/asm-sparc64/floppy.h +++ b/include/asm-sparc64/floppy.h @@ -159,7 +159,7 @@ static void sun_82077_fd_outb(unsigned char value, unsigned long port) * underruns. If non-zero, doing_pdma encodes the direction of * the transfer for debugging. 1=read 2=write */ -char *pdma_vaddr; +unsigned char *pdma_vaddr; unsigned long pdma_size; volatile int doing_pdma = 0; @@ -209,8 +209,7 @@ static void sun_fd_enable_dma(void) pdma_areasize = pdma_size; } -/* Our low-level entry point in arch/sparc/kernel/entry.S */ -extern irqreturn_t floppy_hardint(int irq, void *unused, struct pt_regs *regs); +extern irqreturn_t sparc_floppy_irq(int, void *, struct pt_regs *); static int sun_fd_request_irq(void) { @@ -220,8 +219,8 @@ static int sun_fd_request_irq(void) if(!once) { once = 1; - error = request_fast_irq(FLOPPY_IRQ, floppy_hardint, - SA_INTERRUPT, "floppy", NULL); + error = request_irq(FLOPPY_IRQ, sparc_floppy_irq, + SA_INTERRUPT, "floppy", NULL); return ((error == 0) ? 0 : -1); } @@ -615,7 +614,7 @@ static unsigned long __init sun_floppy_init(void) struct linux_ebus *ebus; struct linux_ebus_device *edev = NULL; unsigned long config = 0; - unsigned long auxio_reg; + void __iomem *auxio_reg; for_each_ebus(ebus) { for_each_ebusdev(edev, ebus) { @@ -642,7 +641,7 @@ static unsigned long __init sun_floppy_init(void) /* Make sure the high density bit is set, some systems * (most notably Ultra5/Ultra10) come up with it clear. */ - auxio_reg = edev->resource[2].start; + auxio_reg = (void __iomem *) edev->resource[2].start; writel(readl(auxio_reg)|0x2, auxio_reg); sun_pci_ebus_dev = ebus->self; @@ -650,7 +649,8 @@ static unsigned long __init sun_floppy_init(void) spin_lock_init(&sun_pci_fd_ebus_dma.lock); /* XXX ioremap */ - sun_pci_fd_ebus_dma.regs = edev->resource[1].start; + sun_pci_fd_ebus_dma.regs = (void __iomem *) + edev->resource[1].start; if (!sun_pci_fd_ebus_dma.regs) return 0; diff --git a/include/asm-sparc64/irq.h b/include/asm-sparc64/irq.h index 3aef0ca67750..018e2e46082b 100644 --- a/include/asm-sparc64/irq.h +++ b/include/asm-sparc64/irq.h @@ -19,7 +19,7 @@ /* You should not mess with this directly. That's the job of irq.c. * * If you make changes here, please update hand coded assembler of - * SBUS/floppy interrupt handler in entry.S -DaveM + * the vectored interrupt trap handler in entry.S -DaveM * * This is currently one DCACHE line, two buckets per L2 cache * line. Keep this in mind please. @@ -122,11 +122,6 @@ extern void enable_irq(unsigned int); extern unsigned int build_irq(int pil, int inofixup, unsigned long iclr, unsigned long imap); extern unsigned int sbus_build_irq(void *sbus, unsigned int ino); -extern int request_fast_irq(unsigned int irq, - irqreturn_t (*handler)(int, void *, struct pt_regs *), - unsigned long flags, __const__ char *devname, - void *dev_id); - static __inline__ void set_softint(unsigned long bits) { __asm__ __volatile__("wr %0, 0x0, %%set_softint" diff --git a/include/asm-sparc64/rwsem.h b/include/asm-sparc64/rwsem.h index bf2ae90ed3df..a1cc94f95984 100644 --- a/include/asm-sparc64/rwsem.h +++ b/include/asm-sparc64/rwsem.h @@ -55,8 +55,9 @@ static __inline__ int rwsem_atomic_update(int delta, struct rw_semaphore *sem) "add %%g1, %1, %%g7\n\t" "cas [%2], %%g1, %%g7\n\t" "cmp %%g1, %%g7\n\t" + "membar #StoreLoad | #StoreStore\n\t" "bne,pn %%icc, 1b\n\t" - " membar #StoreLoad | #StoreStore\n\t" + " nop\n\t" "mov %%g7, %0\n\t" : "=&r" (tmp) : "0" (tmp), "r" (sem) diff --git a/include/asm-sparc64/spinlock.h b/include/asm-sparc64/spinlock.h index db7581bdb531..9cb93a5c2b4f 100644 --- a/include/asm-sparc64/spinlock.h +++ b/include/asm-sparc64/spinlock.h @@ -52,12 +52,14 @@ static inline void _raw_spin_lock(spinlock_t *lock) __asm__ __volatile__( "1: ldstub [%1], %0\n" +" membar #StoreLoad | #StoreStore\n" " brnz,pn %0, 2f\n" -" membar #StoreLoad | #StoreStore\n" +" nop\n" " .subsection 2\n" "2: ldub [%1], %0\n" +" membar #LoadLoad\n" " brnz,pt %0, 2b\n" -" membar #LoadLoad\n" +" nop\n" " ba,a,pt %%xcc, 1b\n" " .previous" : "=&r" (tmp) @@ -95,16 +97,18 @@ static inline void _raw_spin_lock_flags(spinlock_t *lock, unsigned long flags) __asm__ __volatile__( "1: ldstub [%2], %0\n" -" brnz,pn %0, 2f\n" " membar #StoreLoad | #StoreStore\n" +" brnz,pn %0, 2f\n" +" nop\n" " .subsection 2\n" "2: rdpr %%pil, %1\n" " wrpr %3, %%pil\n" "3: ldub [%2], %0\n" -" brnz,pt %0, 3b\n" " membar #LoadLoad\n" +" brnz,pt %0, 3b\n" +" nop\n" " ba,pt %%xcc, 1b\n" -" wrpr %1, %%pil\n" +" wrpr %1, %%pil\n" " .previous" : "=&r" (tmp1), "=&r" (tmp2) : "r"(lock), "r"(flags) @@ -162,12 +166,14 @@ static void inline __read_lock(rwlock_t *lock) "4: add %0, 1, %1\n" " cas [%2], %0, %1\n" " cmp %0, %1\n" +" membar #StoreLoad | #StoreStore\n" " bne,pn %%icc, 1b\n" -" membar #StoreLoad | #StoreStore\n" +" nop\n" " .subsection 2\n" "2: ldsw [%2], %0\n" +" membar #LoadLoad\n" " brlz,pt %0, 2b\n" -" membar #LoadLoad\n" +" nop\n" " ba,a,pt %%xcc, 4b\n" " .previous" : "=&r" (tmp1), "=&r" (tmp2) @@ -204,12 +210,14 @@ static void inline __write_lock(rwlock_t *lock) "4: or %0, %3, %1\n" " cas [%2], %0, %1\n" " cmp %0, %1\n" +" membar #StoreLoad | #StoreStore\n" " bne,pn %%icc, 1b\n" -" membar #StoreLoad | #StoreStore\n" +" nop\n" " .subsection 2\n" "2: lduw [%2], %0\n" +" membar #LoadLoad\n" " brnz,pt %0, 2b\n" -" membar #LoadLoad\n" +" nop\n" " ba,a,pt %%xcc, 4b\n" " .previous" : "=&r" (tmp1), "=&r" (tmp2) @@ -240,8 +248,9 @@ static int inline __write_trylock(rwlock_t *lock) " or %0, %4, %1\n" " cas [%3], %0, %1\n" " cmp %0, %1\n" +" membar #StoreLoad | #StoreStore\n" " bne,pn %%icc, 1b\n" -" membar #StoreLoad | #StoreStore\n" +" nop\n" " mov 1, %2\n" "2:" : "=&r" (tmp1), "=&r" (tmp2), "=&r" (result) diff --git a/include/asm-sparc64/spitfire.h b/include/asm-sparc64/spitfire.h index 9d7613eea812..1aa932773af8 100644 --- a/include/asm-sparc64/spitfire.h +++ b/include/asm-sparc64/spitfire.h @@ -111,7 +111,6 @@ static __inline__ void spitfire_put_dcache_tag(unsigned long addr, unsigned long "membar #Sync" : /* No outputs */ : "r" (tag), "r" (addr), "i" (ASI_DCACHE_TAG)); - __asm__ __volatile__ ("membar #Sync" : : : "memory"); } /* The instruction cache lines are flushed with this, but note that diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index d6eb7b2efc04..9b6d05172ed4 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -175,4 +175,50 @@ struct serio_device_id { }; +/* PCMCIA */ + +struct pcmcia_device_id { + __u16 match_flags; + + __u16 manf_id; + __u16 card_id; + + __u8 func_id; + + /* for real multi-function devices */ + __u8 function; + + /* for pseude multi-function devices */ + __u8 device_no; + + __u32 prod_id_hash[4]; + + /* not matched against in kernelspace*/ +#ifdef __KERNEL__ + const char * prod_id[4]; +#else + kernel_ulong_t prod_id[4]; +#endif + + /* not matched against */ + kernel_ulong_t driver_info; +#ifdef __KERNEL__ + char * cisfile; +#else + kernel_ulong_t cisfile; +#endif +}; + +#define PCMCIA_DEV_ID_MATCH_MANF_ID 0x0001 +#define PCMCIA_DEV_ID_MATCH_CARD_ID 0x0002 +#define PCMCIA_DEV_ID_MATCH_FUNC_ID 0x0004 +#define PCMCIA_DEV_ID_MATCH_FUNCTION 0x0008 +#define PCMCIA_DEV_ID_MATCH_PROD_ID1 0x0010 +#define PCMCIA_DEV_ID_MATCH_PROD_ID2 0x0020 +#define PCMCIA_DEV_ID_MATCH_PROD_ID3 0x0040 +#define PCMCIA_DEV_ID_MATCH_PROD_ID4 0x0080 +#define PCMCIA_DEV_ID_MATCH_DEVICE_NO 0x0100 +#define PCMCIA_DEV_ID_MATCH_FAKE_CIS 0x0200 +#define PCMCIA_DEV_ID_MATCH_ANONYMOUS 0x0400 + #endif /* LINUX_MOD_DEVICETABLE_H */ diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index a3961e1d5183..1e0bc6a8d653 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1815,6 +1815,8 @@ #define PCI_VENDOR_ID_ITE 0x1283 #define PCI_DEVICE_ID_ITE_IT8172G 0x8172 #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801 +#define PCI_DEVICE_ID_ITE_8211 0x8211 +#define PCI_DEVICE_ID_ITE_8212 0x8212 #define PCI_DEVICE_ID_ITE_8872 0x8872 #define PCI_DEVICE_ID_ITE_IT8330G_0 0xe886 diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index 2000b43ece91..da19c297dd65 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h @@ -112,6 +112,8 @@ #define MANFID_TDK 0x0105 #define PRODID_TDK_CF010 0x0900 +#define PRODID_TDK_NP9610 0x0d0a +#define PRODID_TDK_MN3200 0x0e0a #define PRODID_TDK_GN3410 0x4815 #define MANFID_TOSHIBA 0x0098 diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 8d8643adc786..b42ddc0c1143 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h @@ -396,7 +396,6 @@ struct pcmcia_socket; int pcmcia_access_configuration_register(client_handle_t handle, conf_reg_t *reg); int pcmcia_deregister_client(client_handle_t handle); int pcmcia_get_configuration_info(client_handle_t handle, config_info_t *config); -int pcmcia_get_card_services_info(servinfo_t *info); int pcmcia_get_first_window(window_handle_t *win, win_req_t *req); int pcmcia_get_next_window(window_handle_t *win, win_req_t *req); int pcmcia_get_status(client_handle_t handle, cs_status_t *status); @@ -417,7 +416,6 @@ int pcmcia_suspend_card(struct pcmcia_socket *skt); int pcmcia_resume_card(struct pcmcia_socket *skt); int pcmcia_eject_card(struct pcmcia_socket *skt); int pcmcia_insert_card(struct pcmcia_socket *skt); -int pcmcia_report_error(client_handle_t handle, error_info_t *err); struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); void pcmcia_put_socket(struct pcmcia_socket *skt); diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h new file mode 100644 index 000000000000..346d81ece287 --- /dev/null +++ b/include/pcmcia/device_id.h @@ -0,0 +1,249 @@ +/* + * Copyright (2003-2004) Dominik Brodowski <linux@brodo.de> + * David Woodhouse + * + * License: GPL v2 + */ + +#define PCMCIA_DEVICE_MANF_CARD(manf, card) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \ + PCMCIA_DEV_ID_MATCH_CARD_ID, \ + .manf_id = (manf), \ + .card_id = (card), } + +#define PCMCIA_DEVICE_FUNC_ID(func) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FUNC_ID, \ + .func_id = (func), } + +#define PCMCIA_DEVICE_PROD_ID1(v1, vh1) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1, \ + .prod_id = { (v1), NULL, NULL, NULL }, \ + .prod_id_hash = { (vh1), 0, 0, 0 }, } + +#define PCMCIA_DEVICE_PROD_ID2(v2, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2, \ + .prod_id = { NULL, (v2), NULL, NULL }, \ + .prod_id_hash = { 0, (vh2), 0, 0 }, } + +#define PCMCIA_DEVICE_PROD_ID12(v1, v2, vh1, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 }, } + +#define PCMCIA_DEVICE_PROD_ID13(v1, v3, vh1, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3, \ + .prod_id = { (v1), NULL, (v3), NULL }, \ + .prod_id_hash = { (vh1), 0, (vh3), 0 }, } + +#define PCMCIA_DEVICE_PROD_ID14(v1, v4, vh1, vh4) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID4, \ + .prod_id = { (v1), NULL, NULL, (v4) }, \ + .prod_id_hash = { (vh1), 0, 0, (vh4) }, } + +#define PCMCIA_DEVICE_PROD_ID123(v1, v2, v3, vh1, vh2, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3, \ + .prod_id = { (v1), (v2), (v3), NULL },\ + .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, } + +#define PCMCIA_DEVICE_PROD_ID124(v1, v2, v4, vh1, vh2, vh4) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID4, \ + .prod_id = { (v1), (v2), NULL, (v4) }, \ + .prod_id_hash = { (vh1), (vh2), 0, (vh4) }, } + +#define PCMCIA_DEVICE_PROD_ID134(v1, v3, v4, vh1, vh3, vh4) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_PROD_ID4, \ + .prod_id = { (v1), NULL, (v3), (v4) }, \ + .prod_id_hash = { (vh1), 0, (vh3), (vh4) }, } + +#define PCMCIA_DEVICE_PROD_ID1234(v1, v2, v3, v4, vh1, vh2, vh3, vh4) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_PROD_ID4, \ + .prod_id = { (v1), (v2), (v3), (v4) }, \ + .prod_id_hash = { (vh1), (vh2), (vh3), (vh4) }, } + + +/* multi-function devices */ + +#define PCMCIA_MFC_DEVICE_MANF_CARD(mfc, manf, card) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \ + PCMCIA_DEV_ID_MATCH_CARD_ID| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .manf_id = (manf), \ + .card_id = (card), \ + .function = (mfc), } + +#define PCMCIA_MFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { (v1), NULL, NULL, NULL }, \ + .prod_id_hash = { (vh1), 0, 0, 0 }, \ + .function = (mfc), } + +#define PCMCIA_MFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { NULL, (v2), NULL, NULL }, \ + .prod_id_hash = { 0, (vh2), 0, 0 }, \ + .function = (mfc), } + +#define PCMCIA_MFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 }, \ + .function = (mfc), } + +#define PCMCIA_MFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { (v1), NULL, (v3), NULL }, \ + .prod_id_hash = { (vh1), 0, (vh3), 0 }, \ + .function = (mfc), } + +#define PCMCIA_MFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { (v1), (v2), (v3), NULL },\ + .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \ + .function = (mfc), } + +/* pseudo multi-function devices */ + +#define PCMCIA_PFC_DEVICE_MANF_CARD(mfc, manf, card) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \ + PCMCIA_DEV_ID_MATCH_CARD_ID| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .manf_id = (manf), \ + .card_id = (card), \ + .device_no = (mfc), } + +#define PCMCIA_PFC_DEVICE_PROD_ID1(mfc, v1, vh1) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { (v1), NULL, NULL, NULL }, \ + .prod_id_hash = { (vh1), 0, 0, 0 }, \ + .device_no = (mfc), } + +#define PCMCIA_PFC_DEVICE_PROD_ID2(mfc, v2, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { NULL, (v2), NULL, NULL }, \ + .prod_id_hash = { 0, (vh2), 0, 0 }, \ + .device_no = (mfc), } + +#define PCMCIA_PFC_DEVICE_PROD_ID12(mfc, v1, v2, vh1, vh2) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 }, \ + .device_no = (mfc), } + +#define PCMCIA_PFC_DEVICE_PROD_ID13(mfc, v1, v3, vh1, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { (v1), NULL, (v3), NULL }, \ + .prod_id_hash = { (vh1), 0, (vh3), 0 }, \ + .device_no = (mfc), } + +#define PCMCIA_PFC_DEVICE_PROD_ID123(mfc, v1, v2, v3, vh1, vh2, vh3) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { (v1), (v2), (v3), NULL },\ + .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \ + .device_no = (mfc), } + +/* cards needing a CIS override */ + +#define PCMCIA_DEVICE_CIS_MANF_CARD(manf, card, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_MANF_ID| \ + PCMCIA_DEV_ID_MATCH_CARD_ID, \ + .manf_id = (manf), \ + .card_id = (card), \ + .cisfile = (_cisfile)} + +#define PCMCIA_DEVICE_CIS_PROD_ID12(v1, v2, vh1, vh2, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 }, \ + .cisfile = (_cisfile)} + +#define PCMCIA_DEVICE_CIS_PROD_ID123(v1, v2, v3, vh1, vh2, vh3, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_PROD_ID3, \ + .prod_id = { (v1), (v2), (v3), NULL },\ + .prod_id_hash = { (vh1), (vh2), (vh3), 0 }, \ + .cisfile = (_cisfile)} + + +#define PCMCIA_DEVICE_CIS_PROD_ID2(v2, vh2, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID2, \ + .prod_id = { NULL, (v2), NULL, NULL }, \ + .prod_id_hash = { 0, (vh2), 0, 0 }, \ + .cisfile = (_cisfile)} + +#define PCMCIA_PFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_DEVICE_NO, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 },\ + .device_no = (mfc), \ + .cisfile = (_cisfile)} + +#define PCMCIA_MFC_DEVICE_CIS_MANF_CARD(mfc, manf, card, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_MANF_ID| \ + PCMCIA_DEV_ID_MATCH_CARD_ID| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .manf_id = (manf), \ + .card_id = (card), \ + .function = (mfc), \ + .cisfile = (_cisfile)} + +#define PCMCIA_MFC_DEVICE_CIS_PROD_ID12(mfc, v1, v2, vh1, vh2, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID1| \ + PCMCIA_DEV_ID_MATCH_PROD_ID2| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { (v1), (v2), NULL, NULL }, \ + .prod_id_hash = { (vh1), (vh2), 0, 0 }, \ + .function = (mfc), \ + .cisfile = (_cisfile)} + +#define PCMCIA_MFC_DEVICE_CIS_PROD_ID4(mfc, v4, vh4, _cisfile) { \ + .match_flags = PCMCIA_DEV_ID_MATCH_FAKE_CIS | \ + PCMCIA_DEV_ID_MATCH_PROD_ID4| \ + PCMCIA_DEV_ID_MATCH_FUNCTION, \ + .prod_id = { NULL, NULL, NULL, (v4) }, \ + .prod_id_hash = { 0, 0, 0, (vh4) }, \ + .function = (mfc), \ + .cisfile = (_cisfile)} + + +#define PCMCIA_DEVICE_NULL { .match_flags = 0, } diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 312fd958c901..2b52553f2d94 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h @@ -18,6 +18,8 @@ #include <pcmcia/bulkmem.h> #include <pcmcia/cs_types.h> +#include <pcmcia/device_id.h> +#include <linux/mod_devicetable.h> typedef struct tuple_parse_t { tuple_t tuple; @@ -129,12 +131,11 @@ typedef struct dev_link_t { struct pcmcia_socket; -extern struct bus_type pcmcia_bus_type; - struct pcmcia_driver { dev_link_t *(*attach)(void); void (*detach)(dev_link_t *); struct module *owner; + struct pcmcia_device_id *id_table; struct device_driver drv; }; @@ -173,7 +174,9 @@ struct pcmcia_device { u8 has_manf_id:1; u8 has_card_id:1; u8 has_func_id:1; - u8 reserved:5; + + u8 allow_func_id_match:1; + u8 reserved:4; u8 func_id; u16 manf_id; diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 67b867f31fe4..0f7aacc33fe9 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h @@ -15,10 +15,12 @@ #ifndef _LINUX_SS_H #define _LINUX_SS_H +#include <linux/config.h> +#include <linux/device.h> + #include <pcmcia/cs_types.h> #include <pcmcia/cs.h> #include <pcmcia/bulkmem.h> -#include <linux/device.h> /* Definitions for card status flags for GetStatus */ #define SS_WRPROT 0x0001 @@ -171,7 +173,7 @@ typedef struct window_t { struct config_t; struct pcmcia_callback; - +struct user_info_t; struct pcmcia_socket { struct module *owner; @@ -216,8 +218,9 @@ struct pcmcia_socket { /* is set to one if resource setup is done using adjust_resource_info() */ u8 resource_setup_old:1; + u8 resource_setup_new:1; - u8 reserved:6; + u8 reserved:5; /* socket operations */ struct pccard_operations * ops; @@ -241,9 +244,32 @@ struct pcmcia_socket { unsigned int thread_events; /* pcmcia (16-bit) */ - struct pcmcia_bus_socket *pcmcia; struct pcmcia_callback *callback; +#if defined(CONFIG_PCMCIA) || defined(CONFIG_PCMCIA_MODULE) + struct list_head devices_list; /* PCMCIA devices */ + u8 device_count; /* the number of devices, used + * only internally and subject + * to incorrectness and change */ + + struct { + u8 present:1, /* PCMCIA card is present in socket */ + busy:1, /* "master" ioctl is used */ + dead:1, /* pcmcia module is being unloaded */ + device_add_pending:1, /* a pseudo-multifunction-device + * add event is pending */ + reserved:4; + } pcmcia_state; + + struct work_struct device_add; /* for adding further pseudo-multifunction + * devices */ + +#ifdef CONFIG_PCMCIA_IOCTL + struct user_info_t *user; + wait_queue_head_t queue; +#endif +#endif + /* cardbus (32-bit) */ #ifdef CONFIG_CARDBUS struct resource * cb_cis_res; |