minix/common/include/minix/devman.h
Thomas Veerman a209c3ae12 Fix a ton of compiler warnings
This patch fixes most of current reasons to generate compiler warnings.
The changes consist of:
 - adding missing casts
 - hiding or unhiding function declarations
 - including headers where missing
 - add __UNCONST when assigning a const char * to a char *
 - adding missing return statements
 - changing some types from unsigned to signed, as the code seems to want
   signed ints
 - converting old-style function definitions to current style (i.e.,
   void func(param1, param2) short param1, param2; {...} to
   void func (short param1, short param2) {...})
 - making the compiler silent about signed vs unsigned comparisons. We
   have too many of those in the new libc to fix.

A number of bugs in the test set were fixed. These bugs were never
triggered with our old libc. Consequently, these tests are now forced to
link with the new libc or they will generate errors (in particular tests 43
and 55).

Most changes in NetBSD libc are limited to moving aroudn "#ifndef __minix"
or stuff related to Minix-specific things (code in sys-minix or gen/minix).
2011-11-14 10:07:49 +00:00

73 lines
2 KiB
C

#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( void devman_usb_init, (devman_usb_bind_cb_t bind_cb,
devman_usb_bind_cb_t unbind_cb) );
#endif
#endif