From owner-freebsd-questions Mon Aug 25 13:25:27 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id NAA07390 for questions-outgoing; Mon, 25 Aug 1997 13:25:27 -0700 (PDT) Received: from mail.cs.tu-berlin.de (root@mail.cs.tu-berlin.de [130.149.17.13]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id NAA07384 for ; Mon, 25 Aug 1997 13:25:23 -0700 (PDT) Received: from cs.tu-berlin.de (thobe@anonymous222.ppp.cs.tu-berlin.de [130.149.17.222]) by mail.cs.tu-berlin.de (8.8.6/8.8.6) with ESMTP id WAA12508 for ; Mon, 25 Aug 1997 22:13:55 +0200 (MET DST) Message-ID: <3401DA18.BC0FB06E@cs.tu-berlin.de> Date: Mon, 25 Aug 1997 21:16:41 +0200 From: Thomas Berndes Organization: Technical University Berlin, Germany X-Mailer: Mozilla 4.02b7 [en] (X11; I; Linux 2.0.30 i486) MIME-Version: 1.0 To: questions FreeBSD Org Subject: Problems solved (was: Problems developing a network-driver as an kernel-module) Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hello FreeBSD-Programmers,

I solved the problem which i had, while developing a network-driver for FreeBSD
(2.2.1) as a kernel-module.

I have not initialized the "if_sn.ifq_maxlen" - item in the
"ifnet-struct", before making "if_attach( ...)".
 

  • But there still remains the question, why did the driver work fine without this initializiation when linked staticly, and failed, when using it as a kernel-module ?

regards,

  Thomas Berndes
 

==========================================================================

The following lines are an extract from the source-code of the driver.

/* the real initialization of HW and driver */
uDDK_init_driver( ... ){

  ...

  uDDK_P_ifp.if_snd.ifq_maxlen = 3;

  if_attach( &uDDK_P_ifp );

  printf( "%s: Driver initialized\n", pdriver_info->name );
  return uDDK_INIT_DRIVER_OK;
}
 

==========================================================================