reduce number of symbols exported from ni_labpc.o for ni_labpc_cs.o
authorFrank Mori Hess <fmhess@speakeasy.net>
Fri, 4 Jul 2003 18:50:04 +0000 (18:50 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Fri, 4 Jul 2003 18:50:04 +0000 (18:50 +0000)
comedi/drivers/ni_labpc.c
comedi/drivers/ni_labpc.h
comedi/drivers/ni_labpc_cs.c

index 7ea3de0c888c8bd8be0b812caff4051955b60354..2d70b199c4d4dcb8c8cd0b83f48fd0944d2d2427 100644 (file)
@@ -252,8 +252,9 @@ static comedi_lrange range_labpc_plus_ai = {
        }
 };
 
+#define NUM_LABPC_1200_AI_RANGES 14
 // indicates unipolar ranges
-int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
+static int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
 {
        0,
        0,
@@ -271,7 +272,7 @@ int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES] =
        1,
 };
 // map range index to gain bits
-int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
+static int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
 {
        0x00,
        0x20,
@@ -288,7 +289,7 @@ int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES] =
        0x60,
        0x70,
 };
-comedi_lrange range_labpc_1200_ai = {
+static comedi_lrange range_labpc_1200_ai = {
        NUM_LABPC_1200_AI_RANGES,
        {
                BIP_RANGE(5),
@@ -318,6 +319,25 @@ comedi_lrange range_labpc_ao = {
        }
 };
 
+/* functions that do inb/outb and readb/writeb so we can use
+ * function pointers to decide which to use */
+static inline unsigned int labpc_inb(unsigned long address)
+{
+       return inb(address);
+}
+static inline void labpc_outb(unsigned int byte, unsigned long address)
+{
+       outb(byte, address);
+}
+static inline unsigned int labpc_readb(unsigned long address)
+{
+       return readb(address);
+}
+static inline void labpc_writeb(unsigned int byte, unsigned long address)
+{
+       writeb(byte, address);
+}
+
 static labpc_board labpc_boards[] =
 {
        {
@@ -375,6 +395,39 @@ static labpc_board labpc_boards[] =
        },
 };
 
+labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS] =
+{
+       {
+               name:   "daqcard-1200",
+               device_id:      0x103,  // 0x10b is manufacturer id, 0x103 is device id
+               ai_speed:       10000,
+               bustype:        pcmcia_bustype,
+               register_layout:        labpc_1200_layout,
+               has_ao: 1,
+               read_byte:      labpc_inb,
+               write_byte:     labpc_outb,
+               ai_range_table: &range_labpc_1200_ai,
+               ai_range_code: labpc_1200_ai_gain_bits,
+               ai_range_is_unipolar: labpc_1200_is_unipolar,
+               ai_scan_up: 0,
+       },
+       /* duplicate entry, to support using alternate name */
+       {
+               name:   "ni_labpc_cs",
+               device_id:      0x103,
+               ai_speed:       10000,
+               bustype:        pcmcia_bustype,
+               register_layout:        labpc_1200_layout,
+               has_ao: 1,
+               read_byte:      labpc_inb,
+               write_byte:     labpc_outb,
+               ai_range_table: &range_labpc_1200_ai,
+               ai_range_code: labpc_1200_ai_gain_bits,
+               ai_range_is_unipolar: labpc_1200_is_unipolar,
+               ai_scan_up: 0,
+       },
+};
+
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -1938,8 +1991,5 @@ COMEDI_INITCLEANUP(driver_labpc);
 
 EXPORT_SYMBOL_GPL( labpc_common_attach );
 EXPORT_SYMBOL_GPL( labpc_common_detach );
-EXPORT_SYMBOL_GPL( labpc_1200_is_unipolar );
-EXPORT_SYMBOL_GPL( labpc_1200_ai_gain_bits );
-EXPORT_SYMBOL_GPL( range_labpc_1200_ai );
-EXPORT_SYMBOL_GPL( range_labpc_ao );
+EXPORT_SYMBOL_GPL( labpc_cs_boards );
 
index b00199f27373ffb61dcbac4997cb93afcff8d9ed..27b51a576c188c41043e1f7ddf55b41461e15e55 100644 (file)
@@ -70,38 +70,12 @@ typedef struct{
        unsigned int caldac[16];        // stores settings of calibration dacs
 }labpc_private;
 
-//analog input ranges
-// indicates unipolar ranges
-#define NUM_LABPC_1200_AI_RANGES 14
-int labpc_1200_is_unipolar[NUM_LABPC_1200_AI_RANGES];
-// map range index to gain bits
-int labpc_1200_ai_gain_bits[NUM_LABPC_1200_AI_RANGES];
-comedi_lrange range_labpc_1200_ai;
-
-//analog output ranges
-comedi_lrange range_labpc_ao;
+#define NUM_LABPC_CS_BOARDS 2
+labpc_board labpc_cs_boards[NUM_LABPC_CS_BOARDS];
 
 int labpc_common_attach( comedi_device *dev, unsigned long iobase,
        int irq, int dma );
 int labpc_common_detach( comedi_device *dev );
 
-/* functions that do inb/outb and readb/writeb so we can use
- * function pointers to decide which to use */
-static inline unsigned int labpc_inb(unsigned long address)
-{
-       return inb(address);
-}
-static inline void labpc_outb(unsigned int byte, unsigned long address)
-{
-       outb(byte, address);
-}
-static inline unsigned int labpc_readb(unsigned long address)
-{
-       return readb(address);
-}
-static inline void labpc_writeb(unsigned int byte, unsigned long address)
-{
-       writeb(byte, address);
-}
 
 #endif /* _NI_LABPC_H */
index cdb81b53aeb01a758cfe34e25631747423692a62..7e9adf50dec401202d84bab8e62f46b60a24796f 100644 (file)
@@ -93,39 +93,6 @@ static dev_link_t *pcmcia_dev_list = NULL;
 
 static int labpc_attach(comedi_device *dev,comedi_devconfig *it);
 
-static labpc_board labpc_boards[] =
-{
-       {
-               name:   "daqcard-1200",
-               device_id:      0x103,  // 0x10b is manufacturer id, 0x103 is device id
-               ai_speed:       10000,
-               bustype:        pcmcia_bustype,
-               register_layout:        labpc_1200_layout,
-               has_ao: 1,
-               read_byte:      labpc_inb,
-               write_byte:     labpc_outb,
-               ai_range_table: &range_labpc_1200_ai,
-               ai_range_code: labpc_1200_ai_gain_bits,
-               ai_range_is_unipolar: labpc_1200_is_unipolar,
-               ai_scan_up: 0,
-       },
-       /* duplicate entry, to support using alternate name */
-       {
-               name:   "ni_labpc_cs",
-               device_id:      0x103,
-               ai_speed:       10000,
-               bustype:        pcmcia_bustype,
-               register_layout:        labpc_1200_layout,
-               has_ao: 1,
-               read_byte:      labpc_inb,
-               write_byte:     labpc_outb,
-               ai_range_table: &range_labpc_1200_ai,
-               ai_range_code: labpc_1200_ai_gain_bits,
-               ai_range_is_unipolar: labpc_1200_is_unipolar,
-               ai_scan_up: 0,
-       },
-};
-
 /*
  * Useful for shorthand access to the particular board structure
  */
@@ -134,16 +101,14 @@ static labpc_board labpc_boards[] =
 static const int dma_buffer_size = 0xff00;     // size in bytes of dma buffer
 static const int sample_size = 2;      // 2 bytes per sample
 
-#define devpriv ((labpc_private *)dev->private)
-
 static comedi_driver driver_labpc_cs =
 {
        driver_name: "ni_labpc_cs",
        module: THIS_MODULE,
        attach: labpc_attach,
        detach: labpc_common_detach,
-       num_names: sizeof(labpc_boards) / sizeof(labpc_board),
-       board_name: (char **)labpc_boards,
+       num_names: sizeof(labpc_cs_boards) / sizeof(labpc_board),
+       board_name: (char **)labpc_cs_boards,
        offset: sizeof(labpc_board),
 };
 
@@ -765,4 +730,5 @@ void labpc_exit_module(void)
 }
 
 module_init( labpc_init_module );
-module_exit( labpc_exit_module );
\ No newline at end of file
+module_exit( labpc_exit_module );
+