Bug 171532 - [ndis] ndis(4) driver includes 'pccard'-specific code, even if 'device pccard' absent from config
Summary: [ndis] ndis(4) driver includes 'pccard'-specific code, even if 'device pccard...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 8.3-RELEASE
Hardware: Any Any
: Normal Affects Only Me
Assignee: Andriy Voskoboinyk
URL:
Keywords:
: 171531 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-09-11 02:30 UTC by Robert Bonomi
Modified: 2019-02-06 02:13 UTC (History)
4 users (show)

See Also:
avos: mfc-stable10+
avos: mfc-stable11+
avos: mfc-stable12+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Bonomi 2012-09-11 02:30:03 UTC
Two 'if' blocks, one at lines 562-569, and the other at lines 1083-1084, in
sys/dev/if_ndis/if_ndis.c  are RUN-TIME tests for PCMCIA/PC-Card/CARDBUS
hardware, and reference routines that exist only in the 'device pccard'
support modules.  Kernel linking fails if 'device pccard' is not included,
even if the machine has no pccard hardware.

Fix: 

bracket each of the 'if ()' blocks identified above with *COMPILE-TIME*
'#if' or '#ifdef' conditionals on 'something' that is set only if 'device pccard' 
is in the config file.
How-To-Repeat: attempt to compile a kernel with
    option NDISAPI
    device ndis
    device wlan
and WITHOUT
    device pcard

observe the linker failure.
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2012-09-13 14:10:02 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-net

Over to maintainer(s).
Comment 2 Eitan Adler freebsd_committer freebsd_triage 2017-12-31 08:00:24 UTC
For bugs matching the following criteria:

Status: In Progress Changed: (is less than) 2014-06-01

Reset to default assignee and clear in-progress tags.

Mail being skipped
Comment 3 Eugene Grosbein freebsd_committer 2018-01-03 10:26:25 UTC
This is still the problem for stable/11: if_ndis calls functions ndis_alloc_amem/ndis_free_amem from if_ndis_pccard without compile-time checks whether device pccard's included or not.
Comment 4 commit-hook freebsd_committer 2019-01-30 11:40:20 UTC
A commit references this bug:

Author: avos
Date: Wed Jan 30 11:40:13 UTC 2019
New revision: 343574
URL: https://svnweb.freebsd.org/changeset/base/343574

Log:
  Fix compilation with 'option NDISAPI + device ndis' and
  without 'device pccard' in the kernel config file.

  PR:		171532
  Reported by:	Robert Bonomi <bonomi@host128.r-bonomi.com>
  MFC after:	1 week

Changes:
  head/sys/compat/ndis/ndis_var.h
  head/sys/dev/if_ndis/if_ndis.c
  head/sys/dev/if_ndis/if_ndis_pccard.c
Comment 5 Andriy Voskoboinyk freebsd_committer 2019-01-30 11:40:55 UTC
*** Bug 171531 has been marked as a duplicate of this bug. ***
Comment 6 commit-hook freebsd_committer 2019-02-06 02:06:16 UTC
A commit references this bug:

Author: avos
Date: Wed Feb  6 02:06:01 UTC 2019
New revision: 343819
URL: https://svnweb.freebsd.org/changeset/base/343819

Log:
  MFC r343574:
  Fix compilation with 'option NDISAPI + device ndis' and
  without 'device pccard' in the kernel config file.

  PR:		171532
  Reported by:	Robert Bonomi <bonomi@host128.r-bonomi.com>

Changes:
_U  stable/11/
  stable/11/sys/compat/ndis/ndis_var.h
  stable/11/sys/dev/if_ndis/if_ndis.c
  stable/11/sys/dev/if_ndis/if_ndis_pccard.c
_U  stable/12/
  stable/12/sys/compat/ndis/ndis_var.h
  stable/12/sys/dev/if_ndis/if_ndis.c
  stable/12/sys/dev/if_ndis/if_ndis_pccard.c
Comment 7 commit-hook freebsd_committer 2019-02-06 02:08:22 UTC
A commit references this bug:

Author: avos
Date: Wed Feb  6 02:07:37 UTC 2019
New revision: 343820
URL: https://svnweb.freebsd.org/changeset/base/343820

Log:
  MFC r343574:
  Fix compilation with 'option NDISAPI + device ndis' and
  without 'device pccard' in the kernel config file.

  PR:		171532
  Reported by:	Robert Bonomi <bonomi@host128.r-bonomi.com>

Changes:
_U  stable/10/
  stable/10/sys/compat/ndis/ndis_var.h
  stable/10/sys/dev/if_ndis/if_ndis.c
  stable/10/sys/dev/if_ndis/if_ndis_pccard.c