diff options
author | James Maki <jmaki@multitech.com> | 2010-09-10 12:31:45 -0500 |
---|---|---|
committer | James Maki <jmaki@multitech.com> | 2010-09-10 12:31:45 -0500 |
commit | cd819002f664456f9b4c3f48e35457db1a6973a3 (patch) | |
tree | 73e3d8cbbb16b371995872b4c26a7a2d88a0f691 | |
parent | 84feafae92bb0a0521367bcaaa186b27cb5e8a2e (diff) | |
download | mts-id-eeprom-cd819002f664456f9b4c3f48e35457db1a6973a3.tar.gz mts-id-eeprom-cd819002f664456f9b4c3f48e35457db1a6973a3.tar.bz2 mts-id-eeprom-cd819002f664456f9b4c3f48e35457db1a6973a3.zip |
require mts_io.h is installed
-rw-r--r-- | configure.in | 2 | ||||
-rw-r--r-- | src/eeprom_main.c | 2 | ||||
-rw-r--r-- | src/mts_io.h | 54 |
3 files changed, 2 insertions, 56 deletions
diff --git a/configure.in b/configure.in index ae09940..800825b 100644 --- a/configure.in +++ b/configure.in @@ -11,7 +11,7 @@ AC_HEADER_STDC AC_CHECK_HEADERS([ \ stdio.h stdlib.h unistd.h getopt.h errno.h time.h \ ctype.h sys/types.h sys/stat.h fcntl.h stdarg.h string.h printf.h \ -stdint.h sys/ioctl.h linux/limits.h \ +stdint.h sys/ioctl.h linux/limits.h linux/mts_io.h \ ], [],AC_MSG_ERROR([ required header missing])) diff --git a/src/eeprom_main.c b/src/eeprom_main.c index 51a4a87..e9ee652 100644 --- a/src/eeprom_main.c +++ b/src/eeprom_main.c @@ -31,10 +31,10 @@ #include <sys/stat.h> #include <fcntl.h> #include <string.h> +#include <linux/mts_io.h> #include "log.h" #include "eeprom.h" -#include "mts_io.h" static int hwaddr_aton(const char *str, uint8_t *buf, size_t len) { diff --git a/src/mts_io.h b/src/mts_io.h deleted file mode 100644 index e9282cc..0000000 --- a/src/mts_io.h +++ /dev/null @@ -1,54 +0,0 @@ - -#ifndef __MTS_IO_H -#define __MTS_IO_H - -#if !__KERNEL__ -#include <stdint.h> - -#ifndef BIT -#define BIT(nr) (1UL << (nr)) -#endif -#endif - -#define VENDOR_ID_MULTITECH "Multi-Tech Systems" -#define PRODUCT_ID_MTCDP_E1_DK "MTCDP-E1-DK" - -#define HW_VERSION_MTCBA2_2_0 "MTCBA2-2.0" -#define HW_VERSION_MTCDP_0_0 "MTCDP-0.0" -#define HW_VERSION_MTCDP_1_0 "MTCDP-1.0" - -#define DEVICE_CAPA_INDEX(c) (((c) & 0xFF) >> 3) -#define DEVICE_CAPA_MASK(c) BIT((c) & 0x07) - -#define DEVICE_CAPA(capa_buf, c) ((capa_buf)[DEVICE_CAPA_INDEX(c)] & DEVICE_CAPA_MASK(c)) - -#define DEVICE_CAPA_SET(capa_buf, c) \ -do { \ - (capa_buf)[DEVICE_CAPA_INDEX(c)] |= DEVICE_CAPA_MASK(c); \ -}while (0) - -#define DEVICE_CAPA_CLEAR(capa_buf, c) \ -do { \ - (capa_buf)[DEVICE_CAPA_INDEX(c)] &= ~DEVICE_CAPA_MASK(c); \ -} while (0) - -#define DEVICE_CAPA_VALUE(index, bit) ((((index) & 0x1F) << 3) | ((bit) & 0x07)) - -#define CAPA_GPS DEVICE_CAPA_VALUE(0, 7) -#define CAPA_DIN DEVICE_CAPA_VALUE(0, 6) -#define CAPA_DOUT DEVICE_CAPA_VALUE(0, 5) -#define CAPA_ADC DEVICE_CAPA_VALUE(0, 4) - -struct mts_id_eeprom_layout { - char vendor_id[32]; - char product_id[32]; - char device_id[32]; - char hw_version[32]; - uint8_t mac_addr[6]; - char imei[32]; - uint8_t capa[32]; - uint8_t reserved[314]; -}; - -#endif /* ~__MTS_IO_H */ - |