2 * linux/include/linux/l3/l3.h
4 * Copyright (C) 2001 Russell King, All Rights Reserved.
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.
10 * Derived from i2c.h by Simon G. Vogl
16 unsigned char addr
; /* slave address */
19 #define L3_M_NOADDR 0x02
20 unsigned short len
; /* msg length */
21 unsigned char *buf
; /* pointer to msg data */
26 #include <linux/types.h>
27 #include <linux/list.h>
32 /* textual description */
35 /* perform bus transactions */
36 int (*xfer
)(struct l3_adapter
*, struct l3_msg msgs
[], int num
);
42 * l3_adapter is the structure used to identify a physical L3 bus along
43 * with the access algorithms necessary to access it.
47 * This name is used to uniquely identify the adapter.
48 * It should be the same as the module name.
53 * the algorithm to access the bus
55 struct l3_algorithm
*algo
;
58 * Algorithm specific data
63 * This may be NULL, or should point to the module struct
68 * private data for the adapter
73 * Our lock. Unlike the i2c layer, we allow this to be used for
74 * other stuff, like the i2c layer lock. Some people implement
75 * i2c stuff using the same signals as the l3 bus.
77 struct semaphore
*lock
;
80 * List of all adapters.
82 struct list_head adapters
;
85 extern int l3_add_adapter(struct l3_adapter
*);
86 extern int l3_del_adapter(struct l3_adapter
*);
87 extern void l3_put_adapter(struct l3_adapter
*);
88 extern struct l3_adapter
*l3_get_adapter(const char *name
);
90 extern int l3_write(struct l3_adapter
*, int, const char *, int);
91 extern int l3_read(struct l3_adapter
*, int, char *, int);