Subject: kern/2354: MS160SE device driver in kern/2353 lacks a header file
To: None <gnats-bugs@NetBSD.ORG>
From: Tor Egge <tegge@idt.unit.no>
List: netbsd-bugs
Date: 04/29/1996 21:09:43
>Number:         2354
>Category:       kern
>Synopsis:       MS160SE device driver in kern/2353 lacks a header file
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people (Kernel Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Apr 29 15:20:02 1996
>Last-Modified:
>Originator:     tegge@idt.unit.no
>Organization:
	Norwegian Instistute of Science and Technology
>Release:        NETBSD-current
>Environment:
System: NetBSD ikke.idt.unit.no 1.1B NetBSD 1.1B (TEGGE) #13: Tue Apr 23 00:45:57 MET DST 1996 root@ikke.idt.unit.no:/usr/src/sys/arch/i386/compile/TEGGE i386


>Description:
	The MS160SE driver in kern/2353 needs this header.
>How-To-Repeat:
	Post a MS160SE device driver via send-pr without the following
        header file.
>Fix:
*** /dev/null	Mon Apr 29 20:21:50 1996
--- /usr/src/sys/arch/i386/include/ms160se.h	Fri Apr 19 17:43:26 1996
***************
*** 0 ****
--- 1,221 ----
+ /*   $Id: ms160se.h,v 1.1.1.1 1996/04/19 12:48:18 tegge Exp $
+  *
+  * Copyright (c) 1993, 94, 95 Hugo Eide Gunnarsen, Tor Egge
+  * All rights reserved.
+  *
+  * Redistribution and use in source and binary forms, with or without
+  * modification, are permitted provided that the following conditions
+  * are met:
+  * 1. Redistributions of source code must retain the above copyright
+  *    notice, this list of conditions and the following disclaimer.
+  * 2. Redistributions in binary form must reproduce the above copyright
+  *    notice, this list of conditions and the following disclaimer in the
+  *    documentation and/or other materials provided with the distribution.
+  * 3. The name of the author may not be used to endorse or promote products 
+  *    derived from this software without specific prior written permission.
+  *
+  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
+  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  * POSSIBILITY OF SUCH DAMAGE.
+  */
+ 
+ /* This header file contains all structures and defines that both the 
+  * device driver and the program that are going to use the device driver need.
+  *
+  */
+ 
+ /**/
+ #define MS160_MODE_REPORT          	0x00000001	/* Report mode */
+ #define MS160_MODE_STOP            	0x00000002	/* Stop mode */
+ #define MS160_MODE_FLANK           	0x00000004	/* Flank mode */
+ 
+ 
+ typedef struct _WindowS {
+   unsigned short MatchLatency;
+   unsigned short RecordLength;
+   unsigned char Upper[32];
+   unsigned char Lower[32];
+   unsigned char Field[32];
+ } WindowS;
+ 
+ typedef struct _HitS {
+   unsigned long Result;
+   unsigned char HitPattern;
+ } HitS;
+ 
+ typedef struct _HitInfoS {
+   unsigned long NumHits;
+   HitS *Hits;
+   unsigned long HitsLeft;
+ } HitInfoS;
+ 
+ 
+ /* Data router setup:
+ 
+    Folding: Folding mux bitmap control
+    Bit n 0: read directly from data pump ( bit n*8 .. n*8+7 )
+    Bit n 1: Read from the folding mux module for bit ((n+1) % 8) 
+ 
+    Parallel:
+    Bit n 0: Read directly from associated folding mux
+    Bit n 1: Read from the parallel mux module for bit ((n-1) % 8)
+ 
+    Serial:
+    Bit n 0: Read directly from associated parallel mux
+    Bit n 1: Read from 'output' from window ((n-1) % 8)  (--> 'SuperWindow')
+ 
+    Output from serial mux n goes to window n.
+ 
+ */
+ typedef struct _RouteS {
+   unsigned short Serial;
+   unsigned short Parallel;
+   unsigned short Folding;
+ } RouteS;
+ 
+ 
+ typedef struct _MSConfigS 
+ {
+   WindowS Windows[8];
+   /* 
+     Hitmask[] is a 256 bit array addressed by the 'match' bits output from 
+     from the 8 windows. 
+     */
+   unsigned char HitMask[32];   
+   RouteS route;
+   unsigned char mode; 
+ } MSConfigS;
+ 
+ typedef struct _RangeS {
+   unsigned short Start;
+   unsigned short Stop;
+ } RangeS;
+ 
+ typedef struct _MSInitS
+ {
+   unsigned int len;
+   unsigned char *data;
+   unsigned char mcode;
+   unsigned char result;
+   unsigned short base; /* For lmk modules */
+   unsigned char intr;  /* For lmk modules */
+ } MSInitS;
+ 
+ #define MS160_STOP		_IO ('m', 1)
+ #define MS160_START		_IOW ('m', 2, RangeS)
+ #define MS160_GET_HITS		_IOWR('m', 8, HitInfoS)
+ #define MS160_GET_VER		_IOR('m',11, unsigned char)
+ #define MS160_GET_MEM		_IOR('m',12, unsigned long)
+ #define MS160_SET_MAXHITS	_IO ('m',16)
+ #define MS160_GET_MAXHITS	_IOW('m',17, unsigned long)
+ #define MS160_GET_RESULT	_IOR('m',19, HitS)
+ #define MS160_GET_CONFIG	_IOR('m',20, MSConfigS)
+ #define MS160_SET_CONFIG	_IOW('m',21, MSConfigS)
+ #define MS160_INITIALIZE        _IOWR('m',22, MSInitS)
+ 
+ /* label for the data set, so we can check if the correct one is present  */
+ #define MS160_LABEL_SIZE 128
+ #define MS160_GET_LABEL		_IOR('m',23,  char [ MS160_LABEL_SIZE ])
+ #define MS160_SET_LABEL		_IOW('m',24,  char [ MS160_LABEL_SIZE ])
+ 
+ /* Depreciated ioctls */
+ #define MS160_SELECT_WINDOW	_IO ('m', 0)
+ #define MS160_SET_HITMASK	_IOW('m', 3, unsigned char [32]) 
+ #define MS160_GET_HITMASK	_IOR('m', 4, unsigned char [32])
+ #define MS160_GET_MODE		_IOR('m' ,5, unsigned char)
+ #define MS160_SET_MODE		_IO ('m', 6)
+ #define MS160_GET_ROUTE		_IOR('m', 9, RouteS)
+ #define MS160_SET_ROUTE		_IOW('m',10, RouteS)
+ #define MS160_GET_WINDOW	_IOR('m',13, WindowS)
+ #define MS160_SET_WINDOW	_IOW('m',14, WindowS)
+ #define MS160_GET_HIT		_IOR('m', 7, HitS)
+ #define MS160_CLEAR_HITS        _IO ('m',18)
+ 
+ /* Removed ioctls */
+ #if 0
+ #define MS160_SET_RANGE		_IOW('m',15, RangeS)
+ #endif
+ 
+ /* Old junk */
+ #ifdef MS160_OLDJUNK
+ unsigned char StreamNumbers[]={1,2,2,3,3,3,4,4,4,4};
+ unsigned char StreamConfig[10][8][3]={
+ {
+   {0x00,0x00,0x00}
+ },
+ {
+   {0x00,0xAA,0x00},
+   {0x00,0x00,0x55}
+ },
+ {
+   {0xAA,0x00,0x00},
+   {0xAA,0x00,0x55}
+ },
+ {
+   {0x00,0xEE,0x00},
+   {0x00,0xCC,0x11},
+   {0x00,0x88,0x33},
+   {0x00,0x00,0x77}
+ },
+ {
+   {0xAA,0x66,0x00},
+   {0xAA,0x44,0x11},
+   {0xAA,0x00,0x33},
+   {0xAA,0x00,0x77}
+ },
+ {
+   {0xEE,0x00,0x00},
+   {0xEE,0x00,0x11},
+   {0xEE,0x00,0x33},
+   {0xEE,0x00,0x77},
+ },
+ {
+   {0x00,0x0E,0xF0},
+   {0x00,0x1C,0xE1},
+   {0x00,0x38,0xC3},
+   {0x00,0x70,0x87},
+   {0x00,0xE0,0x0F},
+   {0x00,0xC1,0x1E},
+   {0x00,0x83,0x3C},
+   {0x00,0x07,0x78}
+ },
+ {
+   {0xAA,0x06,0xF0},
+   {0xAA,0x1C,0xC1},
+   {0xAA,0x18,0xC3},
+   {0xAA,0x70,0x07},
+   {0xAA,0x60,0x0F},
+   {0xAA,0xC1,0x1C},
+   {0xAA,0x81,0x3C},
+   {0xAA,0x07,0x70}
+ },
+ {
+   {0xEE,0x00,0xF0},
+   {0xEE,0x1C,0x01},
+   {0xEE,0x18,0x03},
+   {0xEE,0x10,0x07},
+   {0xEE,0x00,0x0F},
+   {0xEE,0xC1,0x10},
+   {0xEE,0x81,0x30},
+   {0xEE,0x01,0x70}
+ },
+ {
+   {0xFE,0x00,0x00},
+   {0xFE,0x00,0x01},
+   {0xFE,0x00,0x03},
+   {0xFE,0x00,0x07},
+   {0xFE,0x00,0x0F},
+   {0xFE,0xC1,0x00},
+   {0xFE,0x81,0x00},
+   {0xFE,0x01,0x00}
+ }
+ };
+ #endif

>Audit-Trail:
>Unformatted: