* The select()/deselect() hooks now actually call the socket's request_notification()
and cancel_notification() functions. * Completey dropped the old select code, as well as any R5 compatibility stuff. If we ever need it again, it's still in SVN history. * The socket module was put in uninit_driver() for no reason. * Minor cleanup. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@19256 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
// Forward declaration
|
||||
struct sockaddr;
|
||||
|
||||
#define NET_STACK_DRIVER_DEV "net/stack"
|
||||
#define NET_STACK_DRIVER_PATH "/dev/" NET_STACK_DRIVER_DEV
|
||||
#define NET_STACK_DRIVER_DEVICE "net/stack"
|
||||
#define NET_STACK_DRIVER_PATH "/dev/" NET_STACK_DRIVER_DEVICE
|
||||
|
||||
enum {
|
||||
NET_STACK_IOCTL_BASE = 8800,
|
||||
@@ -105,47 +105,4 @@ struct control_net_module_args { // used by NET_STACK_CONTROL_NET_MODULE
|
||||
size_t length;
|
||||
};
|
||||
|
||||
/*
|
||||
Userland stack driver on_socket_event() callback mecanism implementation:
|
||||
the driver start a kernel thread waiting on a port for
|
||||
a NET_STACK_SOCKET_EVENT_MSG message, which come with a socket_event_data block.
|
||||
|
||||
The on_socket_event() mechanism stay in driver (kernelland) because it's
|
||||
only there we can call kernel's notify_select_event() on BONE systems.
|
||||
For non-BONE systems, we use our own r5_notify_select_event()
|
||||
implementation, that could be moved into the userland net_server code,
|
||||
but it'll have split (again!) the /dev/net/stack driver code...
|
||||
*/
|
||||
|
||||
struct notify_socket_event_args { // used by NET_STACK_NOTIFY_SOCKET_EVENT
|
||||
port_id notify_port; // port waiting for notification, -1 = stop notify
|
||||
void *cookie; // this cookie value will be pass back in the socket_event_args
|
||||
};
|
||||
|
||||
#define NET_STACK_SOCKET_EVENT_NOTIFICATION 'sevn'
|
||||
|
||||
struct socket_event_data {
|
||||
uint32 event; // B_SELECT_READ, B_SELECT_WRITE or B_SELECT_ERROR
|
||||
void *cookie; // The cookie as set in notify_socket_event_args for this socket
|
||||
};
|
||||
|
||||
/*
|
||||
R5.0.3 and before select() kernel support is too buggy to be used, so
|
||||
here are the structures we used to support select() on sockets, and *only* on
|
||||
sockets!
|
||||
*/
|
||||
|
||||
struct select_args { // used by NET_STACK_SELECT and NET_STACK_DESELECT
|
||||
struct selectsync *sync; // in fact, it's the area_id of a r5_selectsync struct!!!
|
||||
uint32 ref;
|
||||
};
|
||||
|
||||
struct r5_selectsync {
|
||||
sem_id lock; // lock this r5_selectsync
|
||||
sem_id wakeup; // sem to release to wakeup select()
|
||||
struct fd_set rbits; // read event bits field
|
||||
struct fd_set wbits; // write event bits field
|
||||
struct fd_set ebits; // exception event bits field
|
||||
};
|
||||
|
||||
#endif /* NET_STACK_DRIVER_H */
|
||||
|
||||
Reference in New Issue
Block a user