~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/isapnp.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-or-later */
  2 /*
  3  *  ISA Plug & Play support
  4  *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  5  */
  6 
  7 #ifndef LINUX_ISAPNP_H
  8 #define LINUX_ISAPNP_H
  9 
 10 #include <linux/errno.h>
 11 #include <linux/pnp.h>
 12 
 13 /*
 14  *
 15  */
 16 
 17 #define ISAPNP_VENDOR(a,b,c)    (((((a)-'A'+1)&0x3f)<<2)|\
 18                                 ((((b)-'A'+1)&0x18)>>3)|((((b)-'A'+1)&7)<<13)|\
 19                                 ((((c)-'A'+1)&0x1f)<<8))
 20 #define ISAPNP_DEVICE(x)        ((((x)&0xf000)>>8)|\
 21                                  (((x)&0x0f00)>>8)|\
 22                                  (((x)&0x00f0)<<8)|\
 23                                  (((x)&0x000f)<<8))
 24 #define ISAPNP_FUNCTION(x)      ISAPNP_DEVICE(x)
 25 
 26 /*
 27  *
 28  */
 29 
 30 #ifdef __KERNEL__
 31 #include <linux/mod_devicetable.h>
 32 
 33 #define DEVICE_COUNT_COMPATIBLE 4
 34 
 35 #define ISAPNP_CARD_DEVS        8
 36 
 37 #define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \
 38                 .card_vendor = ISAPNP_VENDOR(_va, _vb, _vc), .card_device = ISAPNP_DEVICE(_device)
 39 #define ISAPNP_CARD_END \
 40                 .card_vendor = 0, .card_device = 0
 41 #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \
 42                 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) }
 43 
 44 struct isapnp_card_id {
 45         unsigned long driver_data;      /* data private to the driver */
 46         unsigned short card_vendor, card_device;
 47         struct {
 48                 unsigned short vendor, function;
 49         } devs[ISAPNP_CARD_DEVS];       /* logical devices */
 50 };
 51 
 52 #define ISAPNP_DEVICE_SINGLE(_cva, _cvb, _cvc, _cdevice, _dva, _dvb, _dvc, _dfunction) \
 53                 .card_vendor = ISAPNP_VENDOR(_cva, _cvb, _cvc), .card_device =  ISAPNP_DEVICE(_cdevice), \
 54                 .vendor = ISAPNP_VENDOR(_dva, _dvb, _dvc), .function = ISAPNP_FUNCTION(_dfunction)
 55 #define ISAPNP_DEVICE_SINGLE_END \
 56                 .card_vendor = 0, .card_device = 0
 57 
 58 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
 59 
 60 #define __ISAPNP__
 61 
 62 /* lowlevel configuration */
 63 int isapnp_present(void);
 64 int isapnp_cfg_begin(int csn, int device);
 65 int isapnp_cfg_end(void);
 66 unsigned char isapnp_read_byte(unsigned char idx);
 67 void isapnp_write_byte(unsigned char idx, unsigned char val);
 68 
 69 #ifdef CONFIG_PROC_FS
 70 int isapnp_proc_init(void);
 71 int isapnp_proc_done(void);
 72 #else
 73 static inline int isapnp_proc_init(void) { return 0; }
 74 static inline int isapnp_proc_done(void) { return 0; }
 75 #endif
 76 
 77 /* compat */
 78 struct pnp_dev *pnp_find_dev(struct pnp_card *card,
 79                              unsigned short vendor,
 80                              unsigned short function,
 81                              struct pnp_dev *from);
 82 
 83 #else /* !CONFIG_ISAPNP */
 84 
 85 /* lowlevel configuration */
 86 static inline int isapnp_present(void) { return 0; }
 87 static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; }
 88 static inline int isapnp_cfg_end(void) { return -ENODEV; }
 89 static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; }
 90 static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; }
 91 
 92 static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card,
 93                                            unsigned short vendor,
 94                                            unsigned short function,
 95                                            struct pnp_dev *from) { return NULL; }
 96 
 97 #endif /* CONFIG_ISAPNP */
 98 
 99 #endif /* __KERNEL__ */
100 #endif /* LINUX_ISAPNP_H */
101 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php