From owner-cvs-all@FreeBSD.ORG Fri Jan 18 16:31:25 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4A5D516A41A; Fri, 18 Jan 2008 16:31:25 +0000 (UTC) (envelope-from ambrisko@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 23B3E13C469; Fri, 18 Jan 2008 16:31:25 +0000 (UTC) (envelope-from ambrisko@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 m0IGVPLY080940; Fri, 18 Jan 2008 16:31:25 GMT (envelope-from ambrisko@repoman.freebsd.org) Received: (from ambrisko@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m0IGVPeP080939; Fri, 18 Jan 2008 16:31:25 GMT (envelope-from ambrisko) Message-Id: <200801181631.m0IGVPeP080939@repoman.freebsd.org> From: Doug Ambrisko Date: Fri, 18 Jan 2008 16:31:24 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/an if_an.c if_an_pci.c if_anreg.h X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2008 16:31:25 -0000 ambrisko 2008-01-18 16:31:24 UTC FreeBSD src repository Modified files: sys/dev/an if_an.c if_an_pci.c if_anreg.h Log: First real attempt at proper locking. The locking is a little complicated since the the command and data that is being built to be sent to or read from the HW lives in the softc. Commands are later run via an_setdef etc. In the ioctl path various references are kept to the data stored in the softc so it needs to be protected. Almost think of the command in the softc a global variable since it essentially is. Since locking wasn't done in this type of context the commands would get corrupted. Thanks to avatar@ for catching some lock issues and dhw@ for testing. Things are a lot more stable except for the MPI-350 cards. My an(4) remote laptop stays on the network now. The driver should be changed so that it uses private memory that is passed to the functions that talk to the card. Then only those functions would really need to grab locks. Reviewed by: avatar@ Revision Changes Path 1.87 +248 -121 src/sys/dev/an/if_an.c 1.29 +4 -1 src/sys/dev/an/if_an_pci.c 1.25 +1 -0 src/sys/dev/an/if_anreg.h