view vssi/vp2p @ 0:f13167dff80d default tip

2 VSSI patches Found while cleaning up my Lacie disk
author Josef "Jeff" Sipek <jeffpc@josefsipek.net>
date Sat, 25 Aug 2007 19:49:24 -0400
parents
children
line wrap: on
line source

# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
#   2004/12/20 20:47:55-05:00 jeffpc@optonline.net 
#   Merge
# 
# init/main.c
#   2004/12/20 20:47:52-05:00 jeffpc@optonline.net +0 -0
#   SCCS merged
# 
# net/Makefile
#   2004/12/20 20:30:42-05:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# include/linux/socket.h
#   2004/12/20 20:30:42-05:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# include/linux/if_ether.h
#   2004/12/20 20:30:42-05:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/12/20 20:30:42-05:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/10/30 15:18:19-04:00 jeffpc@optonline.net 
#   Added VSSI_INIT
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/10/30 15:18:10-04:00 jeffpc@optonline.net +3 -3
#   Use VSSI_INIT
# 
# include/linux/vssi.h
#   2004/10/30 15:18:10-04:00 jeffpc@optonline.net +4 -2
#   Added VSSI_INIT
# 
# ChangeSet
#   2004/09/21 00:51:12-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/linux-2.5
#   into optonline.net:/home/jeffpc/linux/vp2p-work
# 
# net/Makefile
#   2004/09/21 00:51:06-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# init/main.c
#   2004/09/21 00:51:06-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# include/linux/socket.h
#   2004/09/21 00:51:06-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# include/linux/if_ether.h
#   2004/09/21 00:51:06-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/09/21 00:51:06-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/09/16 10:16:57-04:00 jeffpc@optonline.net 
#   [VSSI] Added a check for closed connections
#   
#   Signed-off-by: Josef "Jeff" Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/09/16 10:16:46-04:00 jeffpc@optonline.net +12 -2
#   Added a check for closed connections.
# 
# ChangeSet
#   2004/08/16 14:31:09-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/linux-2.5
#   into optonline.net:/home/jeffpc/linux/vp2p-work
# 
# init/main.c
#   2004/08/16 14:31:03-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/07/16 11:14:56-04:00 jeffpc@optonline.net 
#   [VSSI] Created 2 macros to manage connection stats
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/16 11:14:46-04:00 jeffpc@optonline.net +3 -3
#   Created 2 macros to manage connection stats
# 
# include/linux/vssi.h
#   2004/07/16 11:14:46-04:00 jeffpc@optonline.net +14 -0
#   Created 2 macros to manage connection stats
# 
# ChangeSet
#   2004/07/14 17:00:40-04:00 jeffpc@optonline.net 
#   [VSSI] Added descriptions of the functions
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/14 17:00:32-04:00 jeffpc@optonline.net +20 -0
#   Added descriptions of the functions
# 
# ChangeSet
#   2004/07/14 16:39:19-04:00 jeffpc@optonline.net 
#   [VSSI] Use RCU for connection list maintainance
#   Remove destroy flag
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/14 16:39:09-04:00 jeffpc@optonline.net +34 -11
#   Use RCU for connection list maintainance
#   Remove destroy flag
# 
# include/linux/vssi.h
#   2004/07/14 16:39:09-04:00 jeffpc@optonline.net +2 -1
#   Use RCU for connection list maintainance
#   Remove destroy flag
# 
# ChangeSet
#   2004/07/11 09:58:23-04:00 jeffpc@optonline.net 
#   [VSSI] Get rid of a compilation warning
#   Include tcp.h since we are using TCP/IP
#   Moved the destroy flag to the correct struct
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# include/linux/vssi.h
#   2004/07/11 09:51:40-04:00 jeffpc@optonline.net +3 -3
#   Get rid of a warning
# 
# net/vssi/daemon.c
#   2004/07/11 09:50:22-04:00 jeffpc@optonline.net +10 -5
#   Get rid of a warning
# 
# net/vssi/daemon.c
#   2004/07/11 09:31:45-04:00 jeffpc@optonline.net +1 -0
#   Include tcp.h since we are using TCP/IP
# 
# include/linux/vssi.h
#   2004/07/11 09:29:06-04:00 jeffpc@optonline.net +1 -1
#   Moved the destroy flag to the correct struct
# 
# ChangeSet
#   2004/07/10 17:23:51-04:00 jeffpc@optonline.net 
#   [VSSI] Added destroy flag
#   Fix bug with ListeningDaemon() not sleeping
#   Socket closing error fix
#   Removed strange if statement
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# include/linux/vssi.h
#   2004/07/10 17:20:55-04:00 jeffpc@optonline.net +1 -0
#   Added destroy flag
# 
# net/vssi/daemon.c
#   2004/07/10 16:57:23-04:00 jeffpc@batlh.(none) +25 -16
#   Fix bug with ListeningDaemon() not sleeping
#   Socket closing error fix
#   Removed strange if statement
# 
# ChangeSet
#   2004/07/09 06:09:00-04:00 jeffpc@batlh.(none) 
#   [VSSI] Added ListeningDaemon() (runs as "vssid/l")
#   ManagementDaemon() runs every HZ/2
#   ManagementDaemon() doesn't listen for new connections now
#   Added prototype for ListeningDaemon()
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/09 06:02:20-04:00 jeffpc@batlh.(none) +18 -3
#   Added ListeningDaemon() (runs as "vssid/l")
#   ManagementDaemon() runs every HZ/2
#   ManagementDaemon() doesn't listen for new connections now
# 
# include/linux/vssi.h
#   2004/07/09 06:00:49-04:00 jeffpc@optonline.net +1 -0
#   Added prototype for ListeningDaemon()
# 
# ChangeSet
#   2004/07/09 05:33:17-04:00 jeffpc@optonline.net 
#   [VSSI] Combined atomic vars start and quit into startstop
#   Added flags VSSI_START and VSSI_STOP
#   Combined atomic variables start and quit into startstop
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# include/linux/vssi.h
#   2004/07/09 05:24:18-04:00 jeffpc@optonline.net +4 -2
#   Combined atomic vars start and quit into startstop
#   Added flags VSSI_START and VSSI_STOP
# 
# net/vssi/daemon.c
#   2004/07/09 05:22:21-04:00 jeffpc@optonline.net +8 -10
#   Combined atomic variables start and quit into startstop
# 
# ChangeSet
#   2004/07/06 21:00:51-04:00 jeffpc@optonline.net 
#   [VSSI] Fixed maxconn statistics bug
#   Add length of the "hello" message to tx_bytes
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/06 21:00:43-04:00 jeffpc@optonline.net +3 -1
#   Fixed maxconn statistics bug
#   Add length of the "hello" message to tx_bytes
# 
# ChangeSet
#   2004/07/06 20:05:30-04:00 jeffpc@optonline.net 
#   [VSSI] Added VSSI_PROC_FS
#   Added vssi_stats
#   Added /proc/vssi/{stats,conns} (configurable)
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/06 20:05:20-04:00 jeffpc@optonline.net +59 -4
#   Added vssi_stats
#   Added /proc/vssi/{stats,conns} (configurable)
# 
# include/linux/vssi.h
#   2004/07/06 20:05:20-04:00 jeffpc@optonline.net +8 -0
#   Added struct vssi_stats
# 
# arch/i386/Kconfig
#   2004/07/06 20:05:20-04:00 jeffpc@optonline.net +9 -0
#   Added VSSI_PROC_FS
# 
# ChangeSet
#   2004/07/06 17:54:20-04:00 jeffpc@optonline.net 
#   [VSSI] Created ManagementDaemon()
#   Moved accept() code into ManagementDaemon()
#   Changed the message sent to the other end
#   MainDaemon() returns void
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/06 17:54:12-04:00 jeffpc@optonline.net +45 -25
#   Created ManagementDaemon()
#   Moved accept() code into ManagementDaemon()
#   Changed the message sent to the other end
# 
# include/linux/vssi.h
#   2004/07/06 17:54:12-04:00 jeffpc@optonline.net +3 -1
#   MainDaemon returns void
#   Added ManagementDaemon
# 
# ChangeSet
#   2004/07/06 10:19:51-04:00 jeffpc@optonline.net 
#   [VSSI] Moved code out of MainDaemon() into newly made vssi_accept_conns(),
#   vssi_allocsock(), vssi_freesock(), and send_hello()
#   Changed length type for vssi_Send() to u32
#   Whitespace cleanup in vssi.h
#   Added connection statistics struct
#   conn->socket is a pointer
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/06 10:19:43-04:00 jeffpc@optonline.net +111 -53
#   Moved code out of MainDaemon() into newly made vssi_accept_conns(),
#   vssi_allocsock(), vssi_freesock(), and send_hello()
#   Changed length type for vssi_Send() to u32
# 
# include/linux/vssi.h
#   2004/07/06 10:19:43-04:00 jeffpc@optonline.net +14 -4
#   Little whitespace cleanup
#   Added connection statistics struct
#   conn->socket is a pointer
# 
# ChangeSet
#   2004/07/02 18:44:10-04:00 jeffpc@optonline.net 
#   [VSSI] Added two out of memory checks
#   Now using socket flags to accept connections
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/07/02 18:44:02-04:00 jeffpc@optonline.net +11 -2
#   Added two out of memory checks
#   Now using socket flags to accept connections
# 
# ChangeSet
#   2004/06/28 11:11:09-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/linux-2.5
#   into optonline.net:/home/jeffpc/linux/vp2p-work
# 
# init/main.c
#   2004/06/28 11:11:04-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/25 00:40:41-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/linux-2.5
#   into optonline.net:/home/jeffpc/linux/vp2p-work
# 
# init/main.c
#   2004/06/25 00:40:36-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/25 00:28:02-04:00 jeffpc@optonline.net 
#   [VSSI] Call daemonize() complete the setup
#   Use TCP/IP instead of UDP/IP
#   Prefix error messages with "vssi: "
#   Fixed return value check (sock->ops->listen() call)
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/06/25 00:27:53-04:00 jeffpc@optonline.net +6 -5
#   Call daemonize() complete the setup
#   Use TCP/IP instead of UDP/IP
#   Prefix error messages with "vssi: "
#   Fixed return value check (sock->ops->listen() call)
# 
# ChangeSet
#   2004/06/24 03:53:05-04:00 jeffpc@optonline.net 
#   [VSSI] Use kernel_thread() instead of daemonize()
#   
#   Note: The kernel now not only compiles, but it also boots if you
#   select both VSSI and VP2P
#   
#   Signed-off-by: Josef 'Jeff' Sipek <jeffpc@optonline.net>
# 
# net/vssi/daemon.c
#   2004/06/24 03:52:51-04:00 jeffpc@optonline.net +3 -5
#   Use kernel_thread() instead of daemonize()
# 
# ChangeSet
#   2004/06/23 03:36:25-04:00 jeffpc@optonline.net 
#   Make sure we execute only on CPU 0
#   Fix up 2 BUGS (check return values)
# 
# net/vssi/daemon.c
#   2004/06/23 03:36:13-04:00 jeffpc@optonline.net +18 -6
#   Make sure we execute only on CPU 0
#   Fix up 2 BUGS (check return values)
# 
# ChangeSet
#   2004/06/22 22:22:04-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/vp2p-2.6
#   into optonline.net:/home/jeffpc/linux/vp2p-work
# 
# init/main.c
#   2004/06/22 22:22:01-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# arch/i386/Kconfig
#   2004/06/22 22:22:01-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/22 22:16:12-04:00 jeffpc@optonline.net 
#   Merge
# 
# init/main.c
#   2004/06/22 22:16:06-04:00 jeffpc@optonline.net +0 -0
#   SCCS merged
# 
# arch/i386/Kconfig
#   2004/06/22 22:09:40-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/20 02:36:01-04:00 jeffpc@optonline.net 
#   [VSSI] Fixed memory leak
#   Send test packet
# 
# net/vssi/daemon.c
#   2004/06/20 02:31:50-04:00 jeffpc@optonline.net +29 -0
#   Fixed memory leak
#   Send test packet
# 
# ChangeSet
#   2004/06/19 23:26:52-04:00 jeffpc@optonline.net 
#   Merge
# 
# init/main.c
#   2004/06/19 23:26:48-04:00 jeffpc@optonline.net +0 -0
#   SCCS merged
# 
# arch/i386/Kconfig
#   2004/06/19 23:24:40-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/11 22:12:48-04:00 jeffpc@optonline.net 
#   [VSSI] Use VSSI_BACKLOG instead of a hardcoded number
#   kfree buffer and buffer structure (this might not fly well)
# 
# net/vssi/daemon.c
#   2004/06/11 22:12:42-04:00 jeffpc@optonline.net +9 -8
#   Use VSSI_BACKLOG instead of a hardcoded number
#   kfree buffer and buffer structure (this might not fly well)
# 
# include/linux/vssi.h
#   2004/06/11 22:12:42-04:00 jeffpc@optonline.net +1 -0
#   Backlog constant added
# 
# ChangeSet
#   2004/06/10 12:31:49-04:00 jeffpc@jeff.home 
#   vssiphp.c:
#     Some changes
#     bk cp fakephp.c vssiphp.c
#     PCI hotplug: fix up a bunch of copyrights that were incorrectly declared.
#     new file
# 
# drivers/pci/hotplug/vssiphp.c
#   2004/06/10 12:31:09-04:00 jeffpc@jeff.home +8 -14
#   Clean up of the comments, and several constants
# 
# drivers/pci/hotplug/vssiphp.c
#   2004/06/10 12:22:57-04:00 jeffpc@jeff.home +0 -0
#   bk cp fakephp.c vssiphp.c
# 
# ChangeSet
#   2004/06/09 21:08:28-04:00 jeffpc@optonline.net 
#   [VP2P] Add new buffer to the list of buffers to be tx
#   Some changes in the struct vssi_buffer
# 
# net/vssi/daemon.c
#   2004/06/09 21:08:20-04:00 jeffpc@optonline.net +13 -6
#   Add new buffer to the list of buffers to be tx
# 
# include/linux/vssi.h
#   2004/06/09 21:08:20-04:00 jeffpc@optonline.net +3 -2
#   Renamed some structure members, added address field
# 
# ChangeSet
#   2004/06/09 07:12:36-04:00 jeffpc@optonline.net 
#   [VP2P] Clear the buffer list after going through it in tx_all
#   Added basic body for Send()
# 
# net/vssi/daemon.c
#   2004/06/09 07:12:30-04:00 jeffpc@optonline.net +20 -1
#   Clear the buffer list after going through it in tx_all
#   Added basic body for Send()
# 
# ChangeSet
#   2004/06/08 22:02:49-04:00 jeffpc@optonline.net 
#   [VP2P] Added vssi_tx_all() dummy code
# 
# net/vssi/daemon.c
#   2004/06/08 22:02:42-04:00 jeffpc@optonline.net +14 -0
#   Added vssi_tx_all() dummy code
# 
# include/linux/vssi.h
#   2004/06/08 22:02:42-04:00 jeffpc@optonline.net +1 -0
#   Added vssi_tx_all() prototype
# 
# ChangeSet
#   2004/06/08 21:48:46-04:00 jeffpc@optonline.net 
#   [VP2P] Clean up FIXME
# 
# net/vssi/daemon.c
#   2004/06/08 21:48:39-04:00 jeffpc@optonline.net +5 -7
#   Clean up FIXME
# 
# ChangeSet
#   2004/06/08 21:33:56-04:00 jeffpc@optonline.net 
#   [VP2P] Itterate through all the connections in the list
# 
# net/vssi/daemon.c
#   2004/06/08 21:33:50-04:00 jeffpc@optonline.net +14 -6
#   Itterate through all the connections in the list
# 
# ChangeSet
#   2004/06/08 20:53:36-04:00 jeffpc@optonline.net 
#   [VP2P] Fixed up compilation issue
# 
# net/vssi/daemon.c
#   2004/06/08 20:53:30-04:00 jeffpc@optonline.net +4 -3
#   Fix up compile
# 
# ChangeSet
#   2004/06/06 20:21:34-04:00 jeffpc@optonline.net 
#   Merge optonline.net:/home/jeffpc/linux/linux-2.5
#   into optonline.net:/home/jeffpc/linux/vp2p-2.6
# 
# init/main.c
#   2004/06/06 20:21:31-04:00 jeffpc@optonline.net +0 -0
#   Auto merged
# 
# ChangeSet
#   2004/06/06 20:14:10-04:00 jeffpc@optonline.net 
#   [VSSI] Spelling/compilation fixes
# 
# net/vssi/daemon.c
#   2004/06/06 20:14:04-04:00 jeffpc@optonline.net +5 -4
#   Spelling/compilation fixes
# 
# init/main.c
#   2004/06/06 20:14:04-04:00 jeffpc@optonline.net +1 -0
#   Include linux/vssi.h
# 
# include/linux/vssi.h
#   2004/06/06 20:14:04-04:00 jeffpc@optonline.net +5 -2
#   Added additional prototypes
# 
# ChangeSet
#   2004/06/06 19:15:46-04:00 jeffpc@optonline.net 
#   [VSSI] Create new sockets upon accept()
# 
# net/vssi/daemon.c
#   2004/06/06 19:15:40-04:00 jeffpc@optonline.net +17 -4
#   Create new sockets upon accept()
# 
# include/linux/vssi.h
#   2004/06/06 19:15:40-04:00 jeffpc@optonline.net +5 -0
#   Added connection information structure
# 
# ChangeSet
#   2004/06/05 01:40:47-04:00 jeffpc@optonline.net 
#   Fixed up dependencies for CONFIG_VSSI
#   Created CONFIG_VSSI_VP2P
# 
# arch/i386/Kconfig
#   2004/06/05 01:40:41-04:00 jeffpc@optonline.net +10 -1
#   Fixed up dependencies for CONFIG_VSSI
#   Created CONFIG_VSSI_VP2P
# 
# ChangeSet
#   2004/06/05 01:17:23-04:00 jeffpc@optonline.net 
#   1.1612.diff
# 
# net/vssi/daemon.c
#   2004/06/05 01:11:03-04:00 jeffpc@optonline.net +24 -0
#   Import patch 1.1612.diff
# 
# include/linux/vssi.h
#   2004/06/05 01:11:03-04:00 jeffpc@optonline.net +16 -2
#   Import patch 1.1612.diff
# 
# ChangeSet
#   2004/06/05 01:17:08-04:00 jeffpc@optonline.net 
#   1.1611.diff
# 
# net/vssi/daemon.c
#   2004/06/05 01:10:48-04:00 jeffpc@optonline.net +12 -6
#   Import patch 1.1611.diff
# 
# include/linux/vssi.h
#   2004/06/05 01:10:48-04:00 jeffpc@optonline.net +6 -0
#   Import patch 1.1611.diff
# 
# ChangeSet
#   2004/06/05 01:16:18-04:00 jeffpc@optonline.net 
#   1.1610.diff
# 
# net/vssi/daemon.c
#   2004/06/05 01:10:35-04:00 jeffpc@optonline.net +8 -4
#   Import patch 1.1610.diff
# 
# include/net/vssip.h
#   2004/06/05 01:10:35-04:00 jeffpc@optonline.net +4 -14
#   Import patch 1.1610.diff
# 
# include/linux/socket.h
#   2004/06/05 01:10:35-04:00 jeffpc@optonline.net +1 -3
#   Import patch 1.1610.diff
# 
# include/linux/if_ether.h
#   2004/06/05 01:10:35-04:00 jeffpc@optonline.net +0 -1
#   Import patch 1.1610.diff
# 
# ChangeSet
#   2004/06/05 01:16:01-04:00 jeffpc@optonline.net 
#   1.1371.612.3.diff
# 
# net/vssi/daemon.c
#   2004/06/05 01:09:42-04:00 jeffpc@optonline.net +9 -0
#   Import patch 1.1371.612.3.diff
# 
# init/main.c
#   2004/06/05 01:09:42-04:00 jeffpc@optonline.net +2 -0
#   Import patch 1.1371.612.3.diff
# 
# include/linux/if_ether.h
#   2004/06/05 01:09:42-04:00 jeffpc@optonline.net +1 -0
#   Import patch 1.1371.612.3.diff
# 
# ChangeSet
#   2004/06/05 01:15:27-04:00 jeffpc@optonline.net 
#   Created basic skeleton for VSSI systems
# 
# net/vssi/daemon.c
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +81 -0
#   BitKeeper file /home/jeffpc/linux/vssi-2.6/net/vssi/daemon.c
# 
# net/vssi/Makefile
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +5 -0
#   BitKeeper file /home/jeffpc/linux/vssi-2.6/net/vssi/Makefile
# 
# include/net/vssip.h
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +20 -0
#   BitKeeper file /home/jeffpc/linux/vssi-2.6/include/linux/vssi.h
# 
# net/vssi/daemon.c
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +0 -0
#   BitKeeper file /home/jeffpc/linux/vp2p-2.6/net/vssi/daemon.c
# 
# net/vssi/Makefile
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +0 -0
#   BitKeeper file /home/jeffpc/linux/vp2p-2.6/net/vssi/Makefile
# 
# net/Makefile
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +1 -0
#   Build net/vssi/ if needed
# 
# include/net/vssip.h
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +0 -0
#   BitKeeper file /home/jeffpc/linux/vp2p-2.6/include/net/vssip.h
# 
# include/linux/socket.h
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +3 -1
#   Added VSSI Protocol and Address Family numbers
# 
# arch/i386/Kconfig
#   2004/06/05 01:09:20-04:00 jeffpc@optonline.net +12 -0
#   VSSI config option
# 
# drivers/pci/hotplug/vssiphp.c
#   2003/08/27 07:44:50-07:00 greg@kroah.com +3 -3
#   PCI hotplug: fix up a bunch of copyrights that were incorrectly declared.
# 
# drivers/pci/hotplug/vssiphp.c
#   2003/06/25 17:24:41-07:00 greg@kroah.com +232 -0
# 
# drivers/pci/hotplug/vssiphp.c
#   2003/06/25 17:24:41-07:00 greg@kroah.com +0 -0
#   BitKeeper file /home/greg/linux/BK/pci-2.5/drivers/pci/hotplug/fakephp.c
# 
diff -Nru a/arch/i386/Kconfig b/arch/i386/Kconfig
--- a/arch/i386/Kconfig	2005-05-07 12:54:02 -04:00
+++ b/arch/i386/Kconfig	2005-05-07 12:54:02 -04:00
@@ -501,6 +501,36 @@
 	  cost of slightly increased overhead in some places. If unsure say
 	  N here.
 
+config VSSI
+	bool "Virtual Single System Image (EXPERIMENTAL)"
+	depends on SMP && !MODULES && HOTPLUG && EXPERIMENTAL
+	help
+	  This option enables the creation of a virtual single system image
+	  cluster. The resulting cluster will behave like a SSI system.
+	  
+	  Note: If you want to use more than 1GB of total RAM, make sure High Memory
+	  Support is turned on.
+	  
+	  If you don't know what to do here, say N.
+
+config VSSI_PROC_FS
+	bool "Virtual Single System Image /proc interface"
+	depends on VSSI && PROC_FS
+	help
+	  This option creates /proc/vssi/ directory along with several files
+	  with statistics and configuration.
+	  
+	  If you don't know what to do here, say N.
+
+config VSSI_VP2P
+	bool "Virtual PCI-2-PCI bridge (EXPERIMENTAL)"
+	depends on VSSI && HOTPLUG_PCI
+	help
+	  This option allows the kernel to create a virtual PCI-2-PCI bridge
+	  over standard ethernet interface.
+	  
+	  If you don't know what to do here, say N.
+
 config PREEMPT
 	bool "Preemptible Kernel"
 	help
diff -Nru a/drivers/pci/hotplug/vssiphp.c b/drivers/pci/hotplug/vssiphp.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/drivers/pci/hotplug/vssiphp.c	2005-05-07 12:54:02 -04:00
@@ -0,0 +1,226 @@
+/*
+ * VSSI Virtual PCI Hot Plug Controller Driver
+ *
+ * Copyright (C) 2004 Josef "Jeff" Sipek <jeffpc@optonline.net>
+ *
+ * Based on Fake PCI Hot Plug Controller Driver (fakephp.c)
+ *
+ * All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, version 2 of the License.
+ *
+ */
+
+/*
+ *
+ * This driver will use the VSSI layer and create virtual PCI bridges
+ * to allow communication between PCI buses on different hosts.
+ *
+ * WARNING, this does NOT turn off the power to the PCI device.  This is
+ * a "logical" removal, not a physical or electrical removal.
+ *
+ * Use this module at your own risk, you have been warned!
+ *
+ * Enabling PCI devices is left as an exercise for the reader...
+ *
+ */
+#include <linux/config.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/init.h>
+#include "pci_hotplug.h"
+#include "../pci.h"
+
+#if !defined(CONFIG_HOTPLUG_PCI_FAKE_MODULE)
+	#define MY_NAME	"fakephp"
+#else
+	#define MY_NAME	THIS_MODULE->name
+#endif
+
+#define dbg(format, arg...)					\
+	do {							\
+		if (debug)					\
+			printk(KERN_DEBUG "%s: " format,	\
+				MY_NAME , ## arg); 		\
+	} while (0)
+#define err(format, arg...) printk(KERN_ERR "%s: " format, MY_NAME , ## arg)
+#define info(format, arg...) printk(KERN_INFO "%s: " format, MY_NAME , ## arg)
+
+#define DRIVER_AUTHOR	"Josef \"Jeff\" Sipek <jeffpc@optonline.net>"
+#define DRIVER_DESC	"Virtual PCI Hot Plug Controller Driver"
+
+struct dummy_slot {
+	struct list_head node;
+	struct hotplug_slot *slot;
+	struct pci_dev *dev;
+};
+
+static int debug;
+static LIST_HEAD(slot_list);
+
+static int enable_slot (struct hotplug_slot *slot);
+static int disable_slot (struct hotplug_slot *slot);
+
+static struct hotplug_slot_ops dummy_hotplug_slot_ops = {
+	.owner			= THIS_MODULE,
+	.enable_slot		= enable_slot,
+	.disable_slot		= disable_slot,
+};
+
+static void dummy_release(struct hotplug_slot *slot)
+{
+	struct dummy_slot *dslot = slot->private;
+
+	list_del(&dslot->node);
+	kfree(dslot->slot->info);
+	kfree(dslot->slot);
+	pci_dev_put(dslot->dev);
+	kfree(dslot);
+}
+
+static int add_slot(struct pci_dev *dev)
+{
+	struct dummy_slot *dslot;
+	struct hotplug_slot *slot;
+	int retval = -ENOMEM;
+
+	slot = kmalloc(sizeof(struct hotplug_slot), GFP_KERNEL);
+	if (!slot)
+		goto error;
+	memset(slot, 0, sizeof(*slot));
+
+	slot->info = kmalloc(sizeof(struct hotplug_slot_info), GFP_KERNEL);
+	if (!slot->info)
+		goto error_slot;
+	memset(slot->info, 0, sizeof(struct hotplug_slot_info));
+
+	slot->info->power_status = 1;
+	slot->info->max_bus_speed = PCI_SPEED_UNKNOWN;
+	slot->info->cur_bus_speed = PCI_SPEED_UNKNOWN;
+
+	slot->name = &dev->dev.bus_id[0];
+	dbg("slot->name = %s\n", slot->name);
+
+	dslot = kmalloc(sizeof(struct dummy_slot), GFP_KERNEL);
+	if (!dslot)
+		goto error_info;
+
+	slot->ops = &dummy_hotplug_slot_ops;
+	slot->release = &dummy_release;
+	slot->private = dslot;
+
+	retval = pci_hp_register(slot);
+	if (retval) {
+		err("pci_hp_register failed with error %d\n", retval);
+		goto error_dslot;
+	}
+
+	dslot->slot = slot;
+	dslot->dev = pci_dev_get(dev);
+	list_add (&dslot->node, &slot_list);
+	return retval;
+
+error_dslot:
+	kfree(dslot);
+error_info:
+	kfree(slot->info);
+error_slot:
+	kfree(slot);
+error:
+	return retval;
+}
+
+static int __init pci_scan_buses(void)
+{
+	struct pci_dev *dev = NULL;
+	int retval = 0;
+
+	while ((dev = pci_get_device(PCI_ANY_ID, PCI_ANY_ID, dev)) != NULL) {
+		retval = add_slot(dev);
+		if (retval) {
+			pci_dev_put(dev);
+			break;
+		}
+	}
+
+	return retval;
+}
+
+static void remove_slot(struct dummy_slot *dslot)
+{
+	int retval;
+
+	dbg("removing slot %s\n", dslot->slot->name);
+	retval = pci_hp_deregister(dslot->slot);
+	if (retval)
+		err("Problem unregistering a slot %s\n", dslot->slot->name);
+}
+
+static int enable_slot(struct hotplug_slot *hotplug_slot)
+{
+	return -ENODEV;
+}
+
+static int disable_slot(struct hotplug_slot *slot)
+{
+	struct dummy_slot *dslot;
+
+	if (!slot)
+		return -ENODEV;
+	dslot = slot->private;
+
+	dbg("%s - physical_slot = %s\n", __FUNCTION__, slot->name);
+
+	/* don't disable bridged devices just yet, we can't handle them easily... */
+	if (dslot->dev->subordinate) {
+		err("Can't remove PCI devices with other PCI devices behind it yet.\n");
+		return -ENODEV;
+	}
+
+	/* remove the device from the pci core */
+	pci_remove_bus_device(dslot->dev);
+
+	/* blow away this sysfs entry and other parts. */
+	remove_slot(dslot);
+
+	return 0;
+}
+
+static void cleanup_slots (void)
+{
+	struct list_head *tmp;
+	struct list_head *next;
+	struct dummy_slot *dslot;
+
+	list_for_each_safe (tmp, next, &slot_list) {
+		dslot = list_entry (tmp, struct dummy_slot, node);
+		remove_slot(dslot);
+	}
+	
+}
+
+static int __init dummyphp_init(void)
+{
+	info(DRIVER_DESC "\n");
+
+	return pci_scan_buses();
+}
+
+
+static void __exit dummyphp_exit(void)
+{
+	cleanup_slots();
+}
+
+module_init(dummyphp_init);
+module_exit(dummyphp_exit);
+
+MODULE_AUTHOR(DRIVER_AUTHOR);
+MODULE_DESCRIPTION(DRIVER_DESC);
+MODULE_LICENSE("GPL");
+MODULE_PARM(debug, "i");
+MODULE_PARM_DESC(debug, "Debugging mode enabled or not");
+
diff -Nru a/include/linux/vssi.h b/include/linux/vssi.h
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/include/linux/vssi.h	2005-05-07 12:54:02 -04:00
@@ -0,0 +1,82 @@
+#ifndef _VSSIP_H
+#define _VSSIP_H
+
+#define VSSIPADDR_ANY	0xffff
+#define PORT		0x7A69
+#define VSSI_BACKLOG	32 /* FIXME: What's a sane backlog value? (== node number?) Should be configurable */
+
+#define VSSI_INIT	0x01
+#define VSSI_START	0x02
+#define VSSI_STOP	0x03
+
+/* global variables */
+extern struct socket *MainSocket;
+extern struct vssi_stats vssi_stats;
+extern atomic_t startstop;
+
+/* structure definitions */
+
+struct vssi_eth_hdr {
+	u8	version, arch;
+	u16	from, to;
+	u16	cmd;
+} __attribute__((packed));
+
+struct vssi_buffer {
+	struct list_head	list;
+	char*			buf;
+	u32			len;
+	u16			to;
+};
+
+struct vssi_stats {
+	u16			conns;
+	u16			maxconns;
+};
+
+struct vssi_conn_stats {
+	unsigned long		rx_bytes;
+	unsigned long		tx_bytes;
+};
+
+struct vssi_conn {
+	struct list_head	list;
+	struct socket*		socket;
+	struct vssi_conn_stats	stats;
+	struct rcu_head		rcuhead;
+};
+
+/* macros */
+
+#define inc_current_conns() \
+	do { \
+		vssi_stats.conns++; \
+		if (vssi_stats.conns > vssi_stats.maxconns) \
+			vssi_stats.maxconns = vssi_stats.conns; \
+	} while(0)
+
+#define dec_current_conns() \
+	do { \
+		vssi_stats.conns--; \
+	} while(0)
+
+/* prototypes */
+
+void vssi_init(void);
+int ManagementDaemon(void * unused);
+int ListeningDaemon(void * unused);
+int MainDaemon(void * unused);
+int StartListening(void);
+void StopListening(void);
+int vssi_Send(u16 node, u32 len, char* buff);
+int vssi_Receive(void);
+void vssi_tx_all(void);
+inline int vssi_accept_conns(void);
+struct vssi_conn * vssi_allocsock(void);
+void vssi_freesock(struct vssi_conn *conn);
+void send_hello(struct vssi_conn *conn);
+int vssi_read_procstats(char *buf, char **start, off_t offset, int count, int *eof, void *data);
+int vssi_read_procconns(char *buf, char **start, off_t offset, int count, int *eof, void *data);
+void vssi_rcufree_conn(struct rcu_head *conn);
+
+#endif
diff -Nru a/init/main.c b/init/main.c
--- a/init/main.c	2005-05-07 12:54:02 -04:00
+++ b/init/main.c	2005-05-07 12:54:02 -04:00
@@ -46,6 +46,7 @@
 #include <linux/rmap.h>
 #include <linux/mempolicy.h>
 #include <linux/key.h>
+#include <linux/vssi.h>
 
 #include <asm/io.h>
 #include <asm/bugs.h>
@@ -743,6 +744,8 @@
 
 	(void) sys_dup(0);
 	(void) sys_dup(0);
+	
+	vssi_init();
 	
 	/*
 	 * We try each of these until one succeeds.
diff -Nru a/net/Makefile b/net/Makefile
--- a/net/Makefile	2005-05-07 12:54:02 -04:00
+++ b/net/Makefile	2005-05-07 12:54:02 -04:00
@@ -42,6 +42,7 @@
 obj-$(CONFIG_ECONET)		+= econet/
 obj-$(CONFIG_VLAN_8021Q)	+= 8021q/
 obj-$(CONFIG_IP_SCTP)		+= sctp/
+obj-$(CONFIG_VSSI)		+= vssi/
 
 ifeq ($(CONFIG_NET),y)
 obj-$(CONFIG_SYSCTL)		+= sysctl_net.o
diff -Nru a/net/vssi/Makefile b/net/vssi/Makefile
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/net/vssi/Makefile	2005-05-07 12:54:02 -04:00
@@ -0,0 +1,5 @@
+#
+# Makefile for the VSSI layer.
+#
+
+obj-y					+= daemon.o
diff -Nru a/net/vssi/daemon.c b/net/vssi/daemon.c
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/net/vssi/daemon.c	2005-05-07 12:54:02 -04:00
@@ -0,0 +1,451 @@
+#include <linux/rcupdate.h>
+#include <linux/proc_fs.h>
+#include <net/sock.h>
+#include <linux/in.h>
+#include <linux/tcp.h>
+#include <net/tcp.h>
+#include <linux/vssi.h>
+
+struct socket *MainSocket;
+struct vssi_stats vssi_stats;
+atomic_t startstop;
+
+LIST_HEAD(vssi_conns);
+spinlock_t vssi_conns_lock = SPIN_LOCK_UNLOCKED;
+LIST_HEAD(vssi_tx_buff);
+spinlock_t vssi_tx_buff_lock = SPIN_LOCK_UNLOCKED;
+
+/*
+ * Start up VSSI daemons
+ */
+
+void vssi_init()
+{
+#ifdef CONFIG_VSSI
+	printk(KERN_WARNING "vssi: 2004/05/09 Josef \"Jeff\" Sipek and Nur Hussein\n");
+	printk(KERN_WARNING "vssi: Enabling vssi management daemon...\n");
+	kernel_thread(ManagementDaemon, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+	
+#ifdef CONFIG_VSSI_PROC_FS
+	/* Set up /proc/vssi/ structure */
+	proc_mkdir_mode("vssi",
+				0	/* default mode */,
+				NULL	/* parent dir */);
+	create_proc_read_entry("vssi/stats",
+				0	/* default mode */,
+				NULL	/* parent dir */,
+				vssi_read_procstats,
+				NULL	/* client data */);
+	create_proc_read_entry("vssi/conns",
+				0	/* default mode */,
+				NULL	/* parent dir */,
+				vssi_read_procconns,
+				NULL	/* client data */);
+#endif
+#endif
+}
+
+/*
+ * Management Daemon code
+ *	- Watch for admin tasks
+ */
+
+int ManagementDaemon(void * unused)
+{
+	atomic_set(&startstop,VSSI_INIT);
+	printk(KERN_WARNING "vssi: Enabling vssi daemon...\n");
+	kernel_thread(MainDaemon, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+	kernel_thread(ListeningDaemon, NULL, CLONE_FS | CLONE_FILES | CLONE_SIGHAND);
+			
+	daemonize("vssid/m");
+	set_cpus_allowed(current, cpumask_of_cpu(0));
+
+	if (StartListening()) {
+		printk(KERN_WARNING "vssi: Error starting up...\n");
+		return 0;
+	}
+	
+	memset(&vssi_stats, 0, sizeof(struct vssi_stats));
+	
+	atomic_set(&startstop,VSSI_START);
+
+	while(atomic_read(&startstop)==VSSI_START) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/2);
+		
+		// watch for admin tasks
+	}
+
+	atomic_set(&startstop,VSSI_STOP);
+
+	StopListening();
+	
+	return 0;
+}
+
+/*
+ * Daemon code dedicated to accepting connections
+ */
+
+int ListeningDaemon(void * unused)
+{
+	daemonize("vssid/l");
+	set_cpus_allowed(current, cpumask_of_cpu(0));
+	
+	while(atomic_read(&startstop)==VSSI_INIT) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/10);
+	}
+
+	while(atomic_read(&startstop)==VSSI_START) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/10);
+		
+		vssi_accept_conns();
+	}
+	
+	return 0;
+}
+
+/*
+ * Main Daemon code
+ */
+
+int MainDaemon(void * unused)
+{
+	struct vssi_conn *cc;
+	struct list_head *list;
+	
+	daemonize("vssid");
+	set_cpus_allowed(current, cpumask_of_cpu(0));
+	
+	while(atomic_read(&startstop)==VSSI_INIT) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/10);
+	}
+	
+	while(atomic_read(&startstop)==VSSI_START) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		schedule_timeout(HZ/10);
+		
+		rcu_read_lock();
+		list_for_each_rcu(list, &vssi_conns) {
+			cc = list_entry(list, struct vssi_conn, list);
+		
+			/* Remove dead sockets */
+			if (cc->socket->sk->sk_state != TCP_ESTABLISHED &&
+			    cc->socket->sk->sk_state != TCP_CLOSE_WAIT) {
+				list_del_rcu(&cc->list);
+				call_rcu(&cc->rcuhead, vssi_rcufree_conn);
+				continue;
+			}
+			
+			//cc->socket.ops->send(cc->socket, "hello", 5);
+			send_hello(cc);
+			
+			/* FIXME:
+				- read(cc->socket, BUFF, COUNT); (nonblock)
+				- add any new packets to a buffer
+			*/
+		}
+		rcu_read_unlock();
+		
+		vssi_tx_all();
+	}
+
+	return 0;
+}
+
+/*
+ * RCU free code
+ */
+
+void vssi_rcufree_conn(struct rcu_head *conn)
+{
+	vssi_freesock(container_of(conn, struct vssi_conn, rcuhead));
+}
+
+/*
+ * Accept connections, add them to the list
+ */
+
+inline int vssi_accept_conns()
+{
+	struct vssi_conn *conn;
+	static int err;
+	
+	if ((conn = vssi_allocsock())==NULL)
+		return -ENOMEM;
+	
+	do {
+		conn->socket->type = MainSocket->type;
+		conn->socket->ops  = MainSocket->ops;
+
+		//if (MainSocket->sk->tp_pinfo.af_tcp.accept_queue==NULL)
+		//	break;
+		
+		err = MainSocket->ops->accept(MainSocket, conn->socket, MainSocket->flags);
+		if (!err) {
+			list_add_rcu(&conn->list, &vssi_conns);
+			conn = vssi_allocsock();
+			
+			inc_current_conns();
+			
+			if (!conn)
+				return -ENOMEM;
+		}
+	} while(!err && atomic_read(&startstop)==VSSI_START);
+	
+	vssi_freesock(conn);
+	return err;
+}
+
+/*
+ * Allocate everything needed to set up a connection struct
+ */
+
+struct vssi_conn* vssi_allocsock()
+{
+	struct vssi_conn *conn;
+	
+	if ((conn = (struct vssi_conn*) kmalloc(sizeof(struct vssi_conn), GFP_ATOMIC)) == NULL)
+		goto nomem;
+	if ((conn->socket = (struct socket*) kmalloc(sizeof(struct socket), GFP_ATOMIC)) == NULL)
+		goto nomem_conn;
+	
+	memset(&conn->stats, 0, sizeof(struct vssi_conn_stats));
+
+	return conn;
+	
+nomem_conn:
+	kfree(conn);
+nomem:
+	printk(KERN_WARNING "vssi: Error allocating memory\n");
+	return NULL;
+}
+
+/*
+ * Free the connection struct
+ */
+
+void vssi_freesock(struct vssi_conn *conn)
+{
+	if (conn == NULL)
+		return;
+	
+	lock_sock(conn->socket->sk);
+	if (conn->socket->sk->sk_state == TCP_ESTABLISHED ||
+	    conn->socket->sk->sk_state == TCP_CLOSE_WAIT) {
+		//conn->socket->sk->sk_protinfo.af_tcp.nonagle = 0;
+		tcp_push_pending_frames(conn->socket->sk, conn->socket->sk->sk_protinfo);
+	}
+	release_sock(conn->socket->sk);
+	
+	sock_release(conn->socket);
+	asm("#d");
+	kfree(conn);
+	
+	dec_current_conns();
+}
+
+/*
+ * Send a "hello"-type message to the other end
+ */
+
+void send_hello(struct vssi_conn *conn)
+{
+	/* for packet sending.. */
+	struct msghdr	msg;
+	mm_segment_t	oldfs;
+	struct iovec	iov;
+	int 		len,len2;
+	
+	msg.msg_name     = 0;
+	msg.msg_namelen  = 0;
+	msg.msg_iov	 = &iov;
+	msg.msg_iovlen   = 1;
+	msg.msg_control  = NULL;
+	msg.msg_controllen = 0;
+	msg.msg_flags    = 0;  /* Synchronous for now */
+	
+	iov.iov_base = "hello from your kernel";
+	iov.iov_len  = 22;
+	
+	len2= 22;
+	len = 0;
+	
+	oldfs = get_fs(); set_fs(KERNEL_DS);
+	len = sock_sendmsg(conn->socket,&msg,len2);
+	set_fs(oldfs);
+
+	if (len != len2)
+		printk(KERN_WARNING "vssi: Warning, %d bytes prepared, but only %d sent\n", len2, len);
+	
+	conn->stats.tx_bytes += len;
+	
+	//conn->socket->ops->shutdown(conn->socket,2); // FIXME: close down the connection
+	
+}
+
+/*
+ * Start listening for new connections
+ */
+
+int StartListening()
+{
+	struct socket *sock;
+	struct sockaddr_in saddr;
+	int error;
+	
+	/* Create a socket */
+	
+	error = sock_create(PF_INET,SOCK_STREAM,IPPROTO_TCP,&sock);
+	if (error<0) {
+		printk(KERN_ERR "vssi: Error, could not create socket\n");
+		return -ERESTARTSYS;
+	}
+	
+	/* Bind to the socket */
+	
+	saddr.sin_family	= AF_INET;
+	saddr.sin_addr.s_addr	= INADDR_ANY;
+	saddr.sin_port		= htons((unsigned short)PORT);
+	
+	error = sock->ops->bind(sock,(struct sockaddr*)&saddr, sizeof(saddr));
+	if (error<0) {
+		printk(KERN_ERR "vssi: Error, could not bind to socket\n");
+		sock_release(sock);
+		return -ERESTARTSYS;
+	}
+
+	/* Somewhat pointless, since no one should be listing this early */
+	sock->sk->sk_reuse = 1;
+	
+	/* Start listening */
+	
+	error = sock->ops->listen(sock, VSSI_BACKLOG);
+	if (error != 0) {
+		printk(KERN_ERR "vssi: Error, could not start listening on socket\n");
+		sock_release(sock);
+		return -ERESTARTSYS;
+	}
+	
+	MainSocket = sock;
+
+	return 0;
+}
+
+/*
+ * Stop listening for new connections
+ */
+
+void StopListening()
+{
+	struct socket *sock;
+	
+	if (MainSocket==NULL)
+		return;
+	
+	sock = MainSocket;
+	MainSocket = NULL;
+	sock_release(sock);
+}
+
+/*
+ * Transmit all queued buffers
+ */
+
+void vssi_tx_all()
+{
+	struct list_head *list;
+	struct vssi_buffer *buf;
+
+	spin_lock(&vssi_tx_buff_lock);
+	
+	list_for_each(list, &vssi_tx_buff) {
+		buf = list_entry(list, struct vssi_buffer, list);
+			
+		/*
+			TODO:
+				- Send buf->buf to buf->to
+				- add buf->len to conn->stats.tx_bytes
+		*/
+		kfree(buf->buf);
+		kfree(buf); /* FIXME: this is going to cause oops at best, and mem corruption at worst */
+	}
+	
+	INIT_LIST_HEAD(&vssi_tx_buff);
+	
+	spin_unlock(&vssi_tx_buff_lock);
+}
+
+/*
+ * Send a buffer of length len to node
+ */
+ 
+int vssi_Send(u16 node, u32 len, char* ptr)
+{
+	struct vssi_buffer *buf = (struct vssi_buffer*) kmalloc(sizeof(struct vssi_buffer), GFP_ATOMIC);
+	
+	if (!buf)
+		return -ENOMEM;
+	
+	buf->to  = node;
+	buf->len = len;
+	buf->buf = ptr;
+	
+	spin_lock(&vssi_tx_buff_lock);
+	list_add_tail(&buf->list, &vssi_tx_buff);
+	spin_unlock(&vssi_tx_buff_lock);
+	
+	return 0;
+}
+
+/*
+ * Receive any streams, save them into newly allocated buffers,
+ * and invoke the appropreate kernel handler
+ */
+
+int vssi_Receive()
+{
+	return 0;
+}
+
+/*
+ * Read all the /proc/vssi/stats
+ */
+
+int vssi_read_procstats(char *buf, char **start, off_t offset, int count, int *eof, void *data)
+{
+	*eof = 1;
+	return sprintf(buf, "conns:\t\t%u\nmaxconns:\t%u\n", vssi_stats.conns, vssi_stats.maxconns);
+}
+
+/*
+ * Read all the /proc/vssi/conns
+ */
+
+int vssi_read_procconns(char *buf, char **start, off_t offset, int count, int *eof, void *data)
+{
+	struct list_head *list;
+	struct vssi_conn *cc;
+	static int len;
+	
+	if (!list_empty(&vssi_conns)) {
+		rcu_read_lock();
+		list_for_each_rcu(list, &vssi_conns) {
+			cc = list_entry(list, struct vssi_conn, list);
+		
+			len += sprintf(buf+len, "%lu %lu\n", cc->stats.rx_bytes, cc->stats.tx_bytes);
+		}
+		rcu_read_unlock();
+	} else
+		len = sprintf(buf, "No connections\n");
+	
+	*eof = 1;
+	return len;
+}
+
+EXPORT_SYMBOL(vssi_init);
+EXPORT_SYMBOL(vssi_Send);
+EXPORT_SYMBOL(vssi_Receive);