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

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

Version: ~ [ linux-5.2 ] ~ [ linux-5.1.16 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.57 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.132 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.184 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.184 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.69 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  *  ISA Plug & Play support
  3  *  Copyright (c) by Jaroslav Kysela <perex@suse.cz>
  4  *
  5  *
  6  *   This program is free software; you can redistribute it and/or modify
  7  *   it under the terms of the GNU General Public License as published by
  8  *   the Free Software Foundation; either version 2 of the License, or
  9  *   (at your option) any later version.
 10  *
 11  *   This program is distributed in the hope that it will be useful,
 12  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 13  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 14  *   GNU General Public License for more details.
 15  *
 16  *   You should have received a copy of the GNU General Public License
 17  *   along with this program; if not, write to the Free Software
 18  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 19  *
 20  */
 21 
 22 #ifndef LINUX_ISAPNP_H
 23 #define LINUX_ISAPNP_H
 24 
 25 #include <linux/errno.h>
 26 #include <linux/pnp.h>
 27 
 28 /*
 29  *
 30  */
 31 
 32 #define ISAPNP_VENDOR(a,b,c)    (((((a)-'A'+1)&0x3f)<<2)|\
 33                                 ((((b)-'A'+1)&0x18)>>3)|((((b)-'A'+1)&7)<<13)|\
 34                                 ((((c)-'A'+1)&0x1f)<<8))
 35 #define ISAPNP_DEVICE(x)        ((((x)&0xf000)>>8)|\
 36                                  (((x)&0x0f00)>>8)|\
 37                                  (((x)&0x00f0)<<8)|\
 38                                  (((x)&0x000f)<<8))
 39 #define ISAPNP_FUNCTION(x)      ISAPNP_DEVICE(x)
 40 
 41 /*
 42  *
 43  */
 44 
 45 #ifdef __KERNEL__
 46 #include <linux/mod_devicetable.h>
 47 
 48 #define DEVICE_COUNT_COMPATIBLE 4
 49 
 50 #define ISAPNP_CARD_DEVS        8
 51 
 52 #define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \
 53                 .card_vendor = ISAPNP_VENDOR(_va, _vb, _vc), .card_device = ISAPNP_DEVICE(_device)
 54 #define ISAPNP_CARD_END \
 55                 .card_vendor = 0, .card_device = 0
 56 #define ISAPNP_DEVICE_ID(_va, _vb, _vc, _function) \
 57                 { .vendor = ISAPNP_VENDOR(_va, _vb, _vc), .function = ISAPNP_FUNCTION(_function) }
 58 
 59 struct isapnp_card_id {
 60         unsigned long driver_data;      /* data private to the driver */
 61         unsigned short card_vendor, card_device;
 62         struct {
 63                 unsigned short vendor, function;
 64         } devs[ISAPNP_CARD_DEVS];       /* logical devices */
 65 };
 66 
 67 #define ISAPNP_DEVICE_SINGLE(_cva, _cvb, _cvc, _cdevice, _dva, _dvb, _dvc, _dfunction) \
 68                 .card_vendor = ISAPNP_VENDOR(_cva, _cvb, _cvc), .card_device =  ISAPNP_DEVICE(_cdevice), \
 69                 .vendor = ISAPNP_VENDOR(_dva, _dvb, _dvc), .function = ISAPNP_FUNCTION(_dfunction)
 70 #define ISAPNP_DEVICE_SINGLE_END \
 71                 .card_vendor = 0, .card_device = 0
 72 
 73 #if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
 74 
 75 #define __ISAPNP__
 76 
 77 /* lowlevel configuration */
 78 int isapnp_present(void);
 79 int isapnp_cfg_begin(int csn, int device);
 80 int isapnp_cfg_end(void);
 81 unsigned char isapnp_read_byte(unsigned char idx);
 82 void isapnp_write_byte(unsigned char idx, unsigned char val);
 83 
 84 #ifdef CONFIG_PROC_FS
 85 int isapnp_proc_init(void);
 86 int isapnp_proc_done(void);
 87 #else
 88 static inline int isapnp_proc_init(void) { return 0; }
 89 static inline int isapnp_proc_done(void) { return 0; }
 90 #endif
 91 
 92 /* compat */
 93 struct pnp_card *pnp_find_card(unsigned short vendor,
 94                                unsigned short device,
 95                                struct pnp_card *from);
 96 struct pnp_dev *pnp_find_dev(struct pnp_card *card,
 97                              unsigned short vendor,
 98                              unsigned short function,
 99                              struct pnp_dev *from);
100 
101 #else /* !CONFIG_ISAPNP */
102 
103 /* lowlevel configuration */
104 static inline int isapnp_present(void) { return 0; }
105 static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; }
106 static inline int isapnp_cfg_end(void) { return -ENODEV; }
107 static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; }
108 static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; }
109 
110 static inline struct pnp_card *pnp_find_card(unsigned short vendor,
111                                              unsigned short device,
112                                              struct pnp_card *from) { return NULL; }
113 static inline struct pnp_dev *pnp_find_dev(struct pnp_card *card,
114                                            unsigned short vendor,
115                                            unsigned short function,
116                                            struct pnp_dev *from) { return NULL; }
117 
118 #endif /* CONFIG_ISAPNP */
119 
120 #endif /* __KERNEL__ */
121 #endif /* LINUX_ISAPNP_H */
122 

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

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | 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.

osdn.jp