From nobody@FreeBSD.org  Sun Sep 22 13:57:55 2013
Return-Path: <nobody@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 EEABFF31
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Sep 2013 13:57:55 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id DD57F20D1
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Sep 2013 13:57:55 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r8MDvqxG063814
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 22 Sep 2013 13:57:52 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r8MDvqCu063810;
	Sun, 22 Sep 2013 13:57:52 GMT
	(envelope-from nobody)
Message-Id: <201309221357.r8MDvqCu063810@oldred.freebsd.org>
Date: Sun, 22 Sep 2013 13:57:52 GMT
From: Gabor Berczi <gabucino@gabucino.be>
To: freebsd-gnats-submit@FreeBSD.org
Subject: ArcNet driver fails to detect the link address - and does not work at all
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         182297
>Category:       kern
>Synopsis:       [cm] ArcNet driver fails to detect the link address - and does not work at all
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-net
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 22 14:00:00 UTC 2013
>Closed-Date:    
>Last-Modified:  Mon Sep 23 18:10:00 UTC 2013
>Originator:     Gabor Berczi
>Release:        8.4
>Organization:
>Environment:
FreeBSD vohaul 8.4-RELEASE-p4 FreeBSD 8.4-RELEASE-p4 #0: Sat Sep 21 11:02:36 CEST 2013     root@i386:/usr/src/sys/i386/compile/ipx  i386

>Description:
Driver output:

> cm0 at port 0x2e0-0x2ef iomem 0xd0000-0xd07ff irq 5 on isa0
> cm0: [ITHREAD]
> cm0: link addr 0xf5 (245)

The problem is, the card's address is not 0xF5.

The detection would take place in dev/cm/smc90cx6.c (cm_attach):

>         linkaddress = GETMEM(CMMACOFF); // CMMACOFF is 1

In fact, not only the offset 1, but any offset I read is "0xF5". This
leads me to think there could be some breakage around memory handling.

smc90cx6var.h:
> #define GETMEM(off)                                                     \
>        bus_space_read_1(rman_get_bustag((sc)->mem_res),                \
>                         rman_get_bushandle((sc)->mem_res),             \
>                         (off))

The card otherwise works fine in DOS and Linux (both can read the link
address correctly).

I also tried with another card, same model. It made no difference. Also
tried setting the card to actually have 0xf5 link address, but it still
didn't work.

>How-To-Repeat:
Try to use it.
>Fix:


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-i386->freebsd-net 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Sep 22 22:03:01 UTC 2013 
Responsible-Changed-Why:  
Reclassify and assign. 

Note to submitter: I haven't heard of any ArcNet cards in a long time. 
Unfortunately, you may be the only person who is in a position to debug 
and fix this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=182297 

From: Gabor Berczi <gabucino@gabucino.be>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/182297: [cm] ArcNet driver fails to detect the link address - and does not work at all
Date: Mon, 23 Sep 2013 19:39:38 +0200

 Tried older kernels, the last release from the v5.x tree was broken too.
 
 I can provide a test environment. Compensation will be given for the  
 fix, if that's an incentive.
 
>Unformatted:
