Added Device Manager (USB hotplug support)
This commit is contained in:
@@ -27,7 +27,7 @@ INCS+= minix/a.out.h minix/cdrom.h minix/cpufeature.h \
|
||||
minix/vfsif.h minix/vtreefs.h \
|
||||
minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
|
||||
minix/audio_fw.h minix/hash.h minix/input.h \
|
||||
minix/usb.h minix/usb_ch9.h
|
||||
minix/devman.h minix/usb.h minix/usb_ch9.h
|
||||
|
||||
INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
|
||||
INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h
|
||||
|
||||
72
include/minix/devman.h
Normal file
72
include/minix/devman.h
Normal file
@@ -0,0 +1,72 @@
|
||||
#ifndef MINIX_LIBDEVMAN_H
|
||||
#define MINIX_LIBDEVMAN_H
|
||||
#include <minix/com.h>
|
||||
#include <minix/ipc.h>
|
||||
#include <minix/usb_ch9.h>
|
||||
|
||||
/* used for serializing */
|
||||
struct devman_device_info {
|
||||
int count;
|
||||
int parent_dev_id;
|
||||
unsigned name_offset;
|
||||
unsigned subsystem_offset;
|
||||
};
|
||||
|
||||
struct devman_device_info_entry {
|
||||
unsigned type;
|
||||
unsigned name_offset;
|
||||
unsigned data_offset;
|
||||
unsigned req_nr;
|
||||
};
|
||||
|
||||
#ifndef DEVMAN_SERVER
|
||||
struct devman_usb_bind_cb_data {
|
||||
int dev_id;
|
||||
int interface;
|
||||
};
|
||||
|
||||
struct devman_usb_interface {
|
||||
struct devman_dev *dev;
|
||||
struct devman_usb_dev *usb_dev;
|
||||
usb_interface_descriptor_t *desc;
|
||||
/* used by the lib */
|
||||
struct devman_usb_bind_cb_data cb_data;
|
||||
};
|
||||
|
||||
struct devman_usb_dev {
|
||||
struct devman_dev *dev;
|
||||
int dev_id; /* The ID identifying the device
|
||||
on server side */
|
||||
usb_device_descriptor_t *desc;
|
||||
|
||||
int configuration; /* the configuration used for this
|
||||
device */
|
||||
|
||||
char *manufacturer;
|
||||
char *product;
|
||||
char *serial;
|
||||
|
||||
int intf_count; /* the number of interfaces in the current
|
||||
configuration */
|
||||
|
||||
struct devman_usb_interface interfaces[32];
|
||||
/* used by the lib */
|
||||
struct devman_usb_bind_cb_data cb_data;
|
||||
};
|
||||
|
||||
typedef int (*devman_usb_bind_cb_t)(struct devman_usb_bind_cb_data *data, endpoint_t ep);
|
||||
|
||||
_PROTOTYPE( int devman_add_device, (struct devman_dev *dev));
|
||||
_PROTOTYPE( int devman_del_device, (struct devman_dev *dev));
|
||||
_PROTOTYPE( int devman_init, (void));
|
||||
_PROTOTYPE( struct devman_usb_dev* devman_usb_device_new, (int dev_id));
|
||||
_PROTOTYPE( int devman_usb_device_add, (struct devman_usb_dev *dev));
|
||||
_PROTOTYPE( int devman_usb_device_remove, (struct devman_usb_dev *dev));
|
||||
_PROTOTYPE( void devman_usb_device_delete, (struct devman_usb_dev *udev));
|
||||
_PROTOTYPE( int devman_handle_msg, (message *m));
|
||||
_PROTOTYPE( int devman_usb_init,(devman_usb_bind_cb_t bind_cb,
|
||||
devman_usb_bind_cb_t unbind_cb));
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user