From owner-freebsd-drivers@FreeBSD.ORG Wed Nov 6 19:18:29 2013 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id B65FE890 for ; Wed, 6 Nov 2013 19:18:29 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 8F3BB264C for ; Wed, 6 Nov 2013 19:18:29 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 8C6BCB9C0; Wed, 6 Nov 2013 14:18:28 -0500 (EST) From: John Baldwin To: Nomad Esst Subject: Re: How igb ports are numbered Date: Wed, 6 Nov 2013 12:09:30 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20130906; KDE/4.5.5; amd64; ; ) References: <1383042426.69884.YahooMailNeo@web162706.mail.bf1.yahoo.com> <201310311433.36740.jhb@freebsd.org> <1383377727.1227.YahooMailNeo@web162702.mail.bf1.yahoo.com> In-Reply-To: <1383377727.1227.YahooMailNeo@web162702.mail.bf1.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201311061209.30355.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Wed, 06 Nov 2013 14:18:28 -0500 (EST) Cc: "freebsd-drivers@freebsd.org" X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Nov 2013 19:18:29 -0000 On Saturday, November 02, 2013 3:35:27 am Nomad Esst wrote: > Thanks for your help. I also found if_initname function which is used in igb_setup_interface function (in if_igb.c file). I've found out that the second argument of if_initname function is used to number ports, can I add an offset to it in order to change port numbering? Is it right? That is what sets the interface names, yes. However, it might be confusing if the interface names do not match the names in dmesg. > On Thursday, October 31, 2013 10:57 PM, John Baldwin wrote: > > On Tuesday, October 29, 2013 6:27:06 am Nomad Esst wrote: > > > >> How this job is done by driver? What should I do in order to change the > >beginning number of ports numbering? > > > >devclasses (devclass_t) assign unit numbers by using a first-free algorithm > >when a new device is added. sys/kern/subr_bus.c is the place to dig for more > >details on this. > > > >-- > >John Baldwin > > > > > > > > -- John Baldwin