patch-2.1.22 linux/net/netbeui/netbeui.c

Next file: linux/net/netrom/af_netrom.c
Previous file: linux/net/lapb/lapb_timer.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.21/linux/net/netbeui/netbeui.c linux/net/netbeui/netbeui.c
@@ -162,21 +162,6 @@
 \*******************************************************************************************************************/
 
 /*
- *	Generic fcntl calls are already dealt with. If we don't need funny ones
- *	this is the all you need. Async I/O is also separate.
- */
-
-static int netbeui_fcntl(struct socket *sock, unsigned int cmd, unsigned long arg)
-{
-/*	netbeui_socket *sk=(netbeui_socket *)sock->data;*/
-	switch(cmd)
-	{
-		default:
-			return(-EINVAL);
-	}
-}
-
-/*
  *	Set 'magic' options for netbeui. If we don't have any this is fine
  *	as it is.
  */
@@ -266,34 +251,6 @@
 }
 
 /*
- *	These are standard.
- */
-
-static void def_callback1(struct sock *sk)
-{
-	if(!sk->dead)
-		wake_up_interruptible(sk->sleep);
-}
-
-static void def_callback2(struct sock *sk, int len)
-{
-	if(!sk->dead)
-	{
-		wake_up_interruptible(sk->sleep);
-		sock_wake_async(sk->socket,1);
-	}
-}
-
-static void def_callback3(struct sock *sk, int len)
-{
-	if(!sk->dead)
-	{
-		wake_up_interruptible(sk->sleep);
-		sock_wake_async(sk->socket,2);
-	}
-}
-
-/*
  *	Create a socket. Initialise the socket, blank the addresses
  *	set the state.
  */
@@ -317,30 +274,8 @@
 
 	MOD_INC_USE_COUNT;
 
-	sk->allocation=GFP_KERNEL;
-	sk->rcvbuf=SK_RMEM_MAX;
-	sk->sndbuf=SK_WMEM_MAX;
-	sk->pair=NULL;
-	sk->priority=SOPRI_NORMAL;
-	skb_queue_head_init(&sk->receive_queue);
-	skb_queue_head_init(&sk->write_queue);
-	skb_queue_head_init(&sk->back_log);
-	sk->state=TCP_CLOSE;
-	sk->socket=sock;
-	sk->type=sock->type;
+	sock_init_data(sock,sk);
 	sk->mtu=1500;
-
-	if(sock!=NULL)
-	{
-		sock->data=(void *)sk;
-		sk->sleep=sock->wait;
-	}
-
-	sk->state_change=def_callback1;
-	sk->data_ready=def_callback2;
-	sk->write_space=def_callback3;
-	sk->error_report=def_callback1;
-	sk->zapped=1;
 	return(0);
 }
 
@@ -881,7 +816,7 @@
 	netbeui_shutdown,
 	netbeui_setsockopt,
 	netbeui_getsockopt,
-	netbeui_fcntl,
+	sock_no_fcntl,
 	netbeui_sendmsg,
 	netbeui_recvmsg
 };

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov