PERFORCE change 134953 for review
Kip Macy
kmacy at FreeBSD.org
Wed Feb 6 20:33:52 PST 2008
http://perforce.freebsd.org/chv.cgi?CH=134953
Change 134953 by kmacy at kmacy:storage:toehead on 2008/02/07 04:33:20
handle had bad CLPs through the full numeric range
Affected files ...
.. //depot/projects/toehead/sys/dev/cxgb/ulp/tom/cxgb_tom.c#6 edit
Differences ...
==== //depot/projects/toehead/sys/dev/cxgb/ulp/tom/cxgb_tom.c#6 (text+ko) ====
@@ -94,7 +94,8 @@
/*
* Handlers for each CPL opcode
*/
-static cxgb_cpl_handler_func tom_cpl_handlers[NUM_CPL_CMDS];
+static cxgb_cpl_handler_func tom_cpl_handlers[256];
+
static eventhandler_tag listen_tag;
@@ -272,7 +273,7 @@
{
log(LOG_ERR, "%s: received bad CPL command %u\n", cdev->name,
0xFF & *mtod(m, unsigned int *));
-
+ kdb_backtrace();
return (CPL_RET_BUF_DONE | CPL_RET_BAD_MSG);
}
@@ -284,7 +285,7 @@
void
t3tom_register_cpl_handler(unsigned int opcode, cxgb_cpl_handler_func h)
{
- if (opcode < NUM_CPL_CMDS)
+ if (opcode < 256)
tom_cpl_handlers[opcode] = h ? h : do_bad_cpl;
else
log(LOG_ERR, "Chelsio T3 TOM: handler registration for "
@@ -329,7 +330,7 @@
{
int i;
- for (i = 0; i < NUM_CPL_CMDS; ++i)
+ for (i = 0; i < 256; ++i)
tom_cpl_handlers[i] = do_bad_cpl;
t3_init_listen_cpl_handlers();
@@ -381,12 +382,9 @@
t->ppod_map = malloc(t->nppods, M_DEVBUF, M_WAITOK);
mtx_init(&t->ppod_map_lock, "ppod map", NULL, MTX_DEF);
-#if 0
- tom_proc_init(dev);
-#ifdef CONFIG_SYSCTL
- t->sysctl = t3_sysctl_register(dev, &t->conf);
-#endif
-#endif
+
+
+ t3_sysctl_register(cdev->adapter, &t->conf);
return (0);
}
@@ -436,6 +434,8 @@
INP_INFO_RUNLOCK(&tcbinfo);
}
+
+
static int
t3_tom_init(void)
{
@@ -466,7 +466,6 @@
return -1;
}
INP_INFO_WLOCK(&tcbinfo);
-
INP_INFO_WUNLOCK(&tcbinfo);
mtx_init(&cxgb_list_lock, "cxgb tom list", NULL, MTX_DEF);
More information about the p4-projects
mailing list