snp.c (36735) | snp.c (42408) |
---|---|
1/* 2 * Copyright (c) 1995 Ugen J.S.Antsilevich 3 * 4 * Redistribution and use in source forms, with and without modification, 5 * are permitted provided that this entire comment appears intact. 6 * 7 * Redistribution in binary form may occur without any restrictions. 8 * Obviously, it would be nice if you gave credit where credit is due --- 121 unchanged lines hidden (view full) --- 130 int flag; 131{ 132 int unit = minor(dev), s; 133 struct snoop *snp = &snoopsw[unit]; 134 int len, n, nblen, error = 0; 135 caddr_t from; 136 char *nbuf; 137 | 1/* 2 * Copyright (c) 1995 Ugen J.S.Antsilevich 3 * 4 * Redistribution and use in source forms, with and without modification, 5 * are permitted provided that this entire comment appears intact. 6 * 7 * Redistribution in binary form may occur without any restrictions. 8 * Obviously, it would be nice if you gave credit where credit is due --- 121 unchanged lines hidden (view full) --- 130 int flag; 131{ 132 int unit = minor(dev), s; 133 struct snoop *snp = &snoopsw[unit]; 134 int len, n, nblen, error = 0; 135 caddr_t from; 136 char *nbuf; 137 |
138#ifdef DIAGNOSTIC 139 if ((snp->snp_len + snp->snp_base) > snp->snp_blen) 140 panic("snoop buffer error"); 141#endif | 138 KASSERT(snp->snp_len + snp->snp_base <= snp->snp_blen, 139 ("snoop buffer error")); |
142 143 if (snp->snp_tty == NULL) 144 return (EIO); 145 146 snp->snp_flags &= ~SNOOP_RWAIT; 147 148 do { 149 if (snp->snp_len == 0) { --- 57 unchanged lines hidden (view full) --- 207 int s, len, nblen; 208 caddr_t from, to; 209 char *nbuf; 210 211 212 if (n == 0) 213 return 0; 214 | 140 141 if (snp->snp_tty == NULL) 142 return (EIO); 143 144 snp->snp_flags &= ~SNOOP_RWAIT; 145 146 do { 147 if (snp->snp_len == 0) { --- 57 unchanged lines hidden (view full) --- 205 int s, len, nblen; 206 caddr_t from, to; 207 char *nbuf; 208 209 210 if (n == 0) 211 return 0; 212 |
215#ifdef DIAGNOSTIC 216 if (n < 0) 217 panic("bad snoop char count"); | 213 KASSERT(n > 0, ("negative snoop char count")); |
218 | 214 |
215#ifdef DIAGNOSTIC |
|
219 if (!(snp->snp_flags & SNOOP_OPEN)) { 220 printf("Snoop: data coming to closed device.\n"); 221 return 0; 222 } 223#endif 224 if (snp->snp_flags & SNOOP_DOWN) { 225 printf("Snoop: more data to down interface.\n"); 226 return 0; --- 319 unchanged lines hidden --- | 216 if (!(snp->snp_flags & SNOOP_OPEN)) { 217 printf("Snoop: data coming to closed device.\n"); 218 return 0; 219 } 220#endif 221 if (snp->snp_flags & SNOOP_DOWN) { 222 printf("Snoop: more data to down interface.\n"); 223 return 0; --- 319 unchanged lines hidden --- |