Annotation of sys/dev/ic/rlncmd.h, Revision 1.1
1.1 ! nbrk 1: /* $OpenBSD: rlncmd.h,v 1.1 1999/07/30 13:43:36 d Exp $ */
! 2: /*
! 3: * David Leonard <d@openbsd.org>, 1999. Public Domain.
! 4: *
! 5: * RangeLAN2 host-to-card message protocol.
! 6: */
! 7:
! 8: /* Micro-message command header. */
! 9: struct rln_mm_cmd {
! 10: u_int8_t cmd_letter; /* Command letter */
! 11: u_int8_t cmd_seq; /* Incremented on each command */
! 12: #define RLN_MAXSEQ 0x7c
! 13: u_int8_t cmd_fn; /* Function number */
! 14: u_int8_t cmd_error; /* Reserved */
! 15: };
! 16: #define RLN_MM_CMD(l,n) ((((unsigned int)l)<<8) | ((unsigned int)n))
! 17: #define RLN_MM_CMD_LETTER(cmd) ((unsigned char)(((cmd) & 0xff00)>>8))
! 18: #define RLN_MM_CMD_FUNCTION(cmd) ((unsigned char)((cmd) & 0xff))
! 19: #define RLN_CMDCODE(letter, num) ((((letter) & 0xff) << 8) | ((num) & 0xff))
! 20:
! 21: /* Initialise card, and set operational parameters. */
! 22: struct rln_mm_init {
! 23: struct rln_mm_cmd mm_cmd;
! 24: #define RLN_MM_INIT { 'A', 0, 0, 0 }
! 25: u_int8_t enaddr[6];
! 26: u_int8_t opmode;
! 27: #define RLN_MM_INIT_OPMODE_NORMAL 0
! 28: #define RLN_MM_INIT_OPMODE_PROMISC 1
! 29: #define RLN_MM_INIT_OPMODE_PROTOCOL 2
! 30: u_int8_t stationtype; /* RLN_STATIONTYPE_... */
! 31: u_int8_t hop_period;
! 32: u_int8_t bfreq;
! 33: u_int8_t sfreq;
! 34: u_char channel : 4; /* lower bits */
! 35: u_char subchannel : 4; /* upper bits */
! 36: char mastername[11];
! 37: u_char sec1 : 4; /* default 3 */
! 38: u_char domain : 4; /* default 0 */
! 39: u_int8_t sec2; /* default 2 */
! 40: u_int8_t sec3; /* default 1 */
! 41: u_int8_t sync_to; /* 1 if roaming */
! 42: u_int8_t xxx_pad; /* zero */
! 43: char syncname[11];
! 44: };
! 45:
! 46: /* Result of initialisation. */
! 47: struct rln_mm_initted {
! 48: struct rln_mm_cmd mm_cmd;
! 49: #define RLN_MM_INITTED { 'a', 0, 0, 0 }
! 50: u_int8_t xxx;
! 51: };
! 52:
! 53: /* Start searching for other masters. */
! 54: struct rln_mm_search {
! 55: struct rln_mm_cmd mm_cmd;
! 56: #define RLN_MM_SEARCH { 'A', 0, 1, 0 }
! 57: u_int8_t xxx1[23];
! 58: u_char xxx2 : 4;
! 59: u_char domain : 4;
! 60: u_int8_t roaming;
! 61: u_int8_t xxx3; /* default 0 */
! 62: u_int8_t xxx4; /* default 1 */
! 63: u_int8_t xxx5; /* default 0 */
! 64: u_int8_t xxx6[11];
! 65: };
! 66:
! 67: /* Notification that searching has started. */
! 68: struct rln_mm_searching {
! 69: struct rln_mm_cmd mm_cmd;
! 70: #define RLN_MM_SEARCHING { 'a', 0, 1, 0 }
! 71: u_int8_t xxx;
! 72: };
! 73:
! 74: /* Terminate search. */
! 75: #define RLN_MM_ABORTSEARCH { 'A', 0, 3, 0 }
! 76:
! 77: /* Station synchronised to a master. */
! 78: struct rln_mm_synchronised {
! 79: struct rln_mm_cmd mm_cmd;
! 80: #define RLN_MM_SYNCHRONISED { 'a', 0, 4, 0 }
! 81: u_char channel : 4; /* lower bits */
! 82: u_char subchannel : 4; /* upper bits */
! 83: char mastername[11];
! 84: u_int8_t enaddr[6];
! 85: };
! 86:
! 87: /* Station lost synchronisation with a master. */
! 88: #define RLN_MM_UNSYNCHRONISED { 'a', 0, 5, 0 }
! 89:
! 90: /* Send card to sleep. (See rln_wakeup().) */
! 91: struct rln_mm_standby {
! 92: struct rln_mm_cmd mm_cmd;
! 93: #define RLN_MM_STANDBY { 'A', 0, 6, 0 }
! 94: u_int8_t xxx; /* default 0 */
! 95: };
! 96:
! 97: /* Set ITO (inactivity timeout timer). */
! 98: struct rln_mm_setito {
! 99: struct rln_mm_cmd mm_cmd;
! 100: #define RLN_MM_SETITO { 'A', 0, 7, 0 }
! 101: u_int8_t xxx; /* default 3 */
! 102: u_int8_t timeout;
! 103: u_char bd_wakeup : 1;
! 104: u_char pm_sync : 7;
! 105: u_int8_t sniff_time;
! 106: };
! 107:
! 108: /* ITO acknowledgment */
! 109: #define RLN_MM_GOTITO { 'a', 0, 7, 0 }
! 110:
! 111: /* Send keepalive protocol message (?). */
! 112: #define RLN_MM_SENDKEEPALIVE { 'A', 0, 8, 0 }
! 113:
! 114: /* Set multicast mode. */
! 115: struct rln_mm_multicast {
! 116: struct rln_mm_cmd mm_cmd;
! 117: #define RLN_MM_MULTICAST { 'A', 0, 9, 0 }
! 118: u_int8_t enable;
! 119: };
! 120:
! 121: /* Ack multicast mode change. */
! 122: #define RLN_MM_MULTICASTING { 'a', 0, 9, 0 }
! 123:
! 124: /* Request statistics. */
! 125: #define RLN_MM_GETSTATS { 'A', 0, 11, 0 }
! 126:
! 127: /* Statistics results. */
! 128: #define RLN_MM_GOTSTATS { 'a', 0, 11, 0 }
! 129:
! 130: /* Set security ID used in channel. */
! 131: struct rln_mm_setsecurity {
! 132: struct rln_mm_cmd mm_cmd;
! 133: #define RLN_MM_SETSECURITY { 'A', 0, 12, 0 }
! 134: u_int8_t sec1;
! 135: u_int8_t sec2;
! 136: u_int8_t sec3;
! 137: };
! 138:
! 139: /* Ack set security ID. */
! 140: #define RLN_MM_GOTSECURITY { 'a', 0, 12, 0 }
! 141:
! 142: /* Request firmware version. */
! 143: #define RLN_MM_GETPROMVERSION { 'A', 0, 13, 0 }
! 144:
! 145: /* Reply with firmware version. */
! 146: struct rln_mm_gotpromversion {
! 147: struct rln_mm_cmd mm_cmd;
! 148: #define RLN_MM_GOTPROMVERSION { 'a', 0, 13, 0 }
! 149: u_int8_t xxx; /* sizeof version? */
! 150: char version[7];
! 151: };
! 152:
! 153: /* Request station's MAC address (same as ethernet). */
! 154: #define RLN_MM_GETENADDR { 'A', 0, 14, 0 }
! 155:
! 156: /* Reply with station's MAC address. */
! 157: struct rln_mm_gotenaddr {
! 158: struct rln_mm_cmd mm_cmd;
! 159: #define RLN_MM_GOTENADDR { 'a', 0, 14, 0 }
! 160: u_int8_t xxx;
! 161: u_int8_t enaddr[6];
! 162: };
! 163:
! 164: /* Tune various channel parameters. */
! 165: struct rln_mm_setmagic {
! 166: struct rln_mm_cmd mm_cmd;
! 167: #define RLN_MM_SETMAGIC { 'A', 0, 16, 0 }
! 168: u_char fairness_slot : 3;
! 169: u_char deferral_slot : 5;
! 170: u_int8_t regular_mac_retry; /* default 0x07 */
! 171: u_int8_t frag_mac_retry; /* default 0x0a */
! 172: u_int8_t regular_mac_qfsk; /* default 0x02 */
! 173: u_int8_t frag_mac_qfsk; /* default 0x05 */
! 174: u_int8_t xxx1; /* default 0xff */
! 175: u_int8_t xxx2; /* default 0xff */
! 176: u_int8_t xxx3; /* default 0xff */
! 177: u_int8_t xxx4; /* zero */
! 178: };
! 179:
! 180: /* Ack channel tuning. */
! 181: #define RLN_MM_GOTMAGIC { 'a', 0, 16, 0 }
! 182:
! 183: /* Set roaming parameters - used when multiple masters available. */
! 184: struct rln_mm_setroaming {
! 185: struct rln_mm_cmd mm_cmd;
! 186: #define RLN_MM_SETROAMING { 'A', 0, 17, 0 }
! 187: u_int8_t sync_alarm;
! 188: u_int8_t retry_thresh;
! 189: u_int8_t rssi_threshold;
! 190: u_int8_t xxx1; /* default 0x5a */
! 191: u_int8_t sync_rssi_threshold;
! 192: u_int8_t xxx2; /* default 0xa5 */
! 193: u_int8_t missed_sync;
! 194: };
! 195:
! 196: /* Ack roaming parameter change. */
! 197: #define RLN_MM_GOTROAMING { 'a', 0, 17, 0 }
! 198:
! 199: #define RLN_MM_ROAMING { 'a', 0, 18, 0 }
! 200: #define RLN_MM_ROAM { 'A', 0, 19, 0 }
! 201:
! 202: /* Hardware fault notification. (Usually the antenna.) */
! 203: #define RLN_MM_FAULT { 'a', 0, 20, 0 }
! 204:
! 205: #define RLN_MM_EEPROM_PROTECT { 'A', 0, 23, 0 }
! 206: #define RLN_MM_EEPROM_PROTECTED { 'a', 0, 23, 0 }
! 207: #define RLN_MM_EEPROM_UNPROTECT { 'A', 0, 24, 0 }
! 208: #define RLN_MM_EEPROM_UNPROTECTED { 'a', 0, 24, 0 }
! 209:
! 210: /* Receive hop statistics. */
! 211: #define RLN_MM_HOP_STATISTICS { 'a', 0, 35, 0 }
! 212:
! 213: /* Transmit a frame on the channel. */
! 214: struct rln_mm_sendpacket {
! 215: struct rln_mm_cmd mm_cmd;
! 216: #define RLN_MM_SENDPACKET { 'B', 0, 0, 0 }
! 217: u_int8_t mode;
! 218: #define RLN_MM_SENDPACKET_MODE_BIT7 0x80
! 219: #define RLN_MM_SENDPACKET_MODE_ZFIRST 0x20
! 220: #define RLN_MM_SENDPACKET_MODE_QFSK 0x03
! 221: u_int8_t power; /* default 0x70 */
! 222: u_int8_t length_lo;
! 223: u_int8_t length_hi;
! 224: u_int8_t xxx1; /* default 0 */
! 225: u_int8_t xxx2; /* default 0 */
! 226: u_int8_t sequence; /* must increment */
! 227: u_int8_t xxx3; /* default 0 */
! 228: };
! 229:
! 230: /* Ack packet transmission. */
! 231: #define RLN_MM_SENTPACKET { 'b', 0, 0, 0 }
! 232:
! 233: /* Notification of frame received from channel. */
! 234: struct rln_mm_recvpacket {
! 235: struct rln_mm_cmd mm_cmd;
! 236: #define RLN_MM_RECVPACKET { 'b', 0, 1, 0 }
! 237: u_int8_t xxx[8];
! 238: };
! 239:
! 240: /* Disable hopping. (?) */
! 241: struct rln_mm_disablehopping {
! 242: struct rln_mm_cmd mm_cmd;
! 243: #define RLN_MM_DISABLEHOPPING { 'C', 0, 9, 0 }
! 244: u_int8_t hopflag;
! 245: #define RLN_MM_DISABLEHOPPING_HOPFLAG_DISABLE 0x52
! 246: };
! 247:
CVSweb