From owner-p4-projects@FreeBSD.ORG Thu Feb 7 04:33:52 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 60DFC16A420; Thu, 7 Feb 2008 04:33:52 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2650D16A419 for ; Thu, 7 Feb 2008 04:33:52 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 0710D13C46E for ; Thu, 7 Feb 2008 04:33:52 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m174XplI002574 for ; Thu, 7 Feb 2008 04:33:51 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m174XpvX002571 for perforce@freebsd.org; Thu, 7 Feb 2008 04:33:51 GMT (envelope-from kmacy@freebsd.org) Date: Thu, 7 Feb 2008 04:33:51 GMT Message-Id: <200802070433.m174XpvX002571@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 134953 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2008 04:33:52 -0000 http://perforce.freebsd.org/chv.cgi?CH=134953 Change 134953 by kmacy@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);