Re: zfs panic when 'make buildworld buildkernel'

2020-10-14 Thread YAMAMOTO Shigeru


Thank you for your help.

after 
https://svnweb.freebsd.org/base?view=revision=366685

I update kernel and try to 'make buildworld buildkernel'.

1st time, I can finished 'make buildworld buildkernel'.

2nd time, panic

```
[root@jenkins-02 ~]# uname -a
FreeBSD jenkins-02.current.os-hackers.jp 13.0-CURRENT FreeBSD 13.0-CURRENT
#0 r366693: Wed Oct 14 21:04:42 JST 2020
r...@jenkins-02.current.os-hackers.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
[root@jenkins-02 ~]#
```

```
flags ()
lock type zfs: UNLOCKED
panic: No vop_fplookup_vexec(0xf80057f061f0, 0xfe004b286688)
cpuid = 1
time = 1602733349
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
0xfe004b286570
vpanic() at vpanic+0x182/frame 0xfe004b2865c0
panic() at panic+0x43/frame 0xfe004b286620
VOP_FPLOOKUP_VEXEC_APV() at VOP_FPLOOKUP_VEXEC_APV+0x125/frame
0xfe004b286640
cache_fplookup() at cache_fplookup+0x437/frame 0xfe004b286750
namei() at namei+0x149/frame 0xfe004b286810
vn_open_cred() at vn_open_cred+0x336/frame 0xfe004b286970
kern_openat() at kern_openat+0x25a/frame 0xfe004b286ad0
amd64_syscall() at amd64_syscall+0x135/frame 0xfe004b286bf0
fast_syscall_common() at fast_syscall_common+0xf8/frame
0xfe004b286bf0
--- syscall (499, FreeBSD ELF64, sys_openat), rip = 0x805909caa, rsp =
0x7fff71a8, rbp = 0x7fff7220 ---
KDB: enter: panic
[ thread pid 84431 tid 100664 ]
Stopped at  kdb_enter+0x37: movq$0,0x10b0116(%rip)
db>
```

```
db> trace
Tracing pid 84431 tid 100664 td 0xfe004b1e8000
kdb_enter() at kdb_enter+0x37/frame 0xfe004b286570
vpanic() at vpanic+0x19e/frame 0xfe004b2865c0
panic() at panic+0x43/frame 0xfe004b286620
VOP_FPLOOKUP_VEXEC_APV() at VOP_FPLOOKUP_VEXEC_APV+0x125/frame
0xfe004b286640
cache_fplookup() at cache_fplookup+0x437/frame 0xfe004b286750
namei() at namei+0x149/frame 0xfe004b286810
vn_open_cred() at vn_open_cred+0x336/frame 0xfe004b286970
kern_openat() at kern_openat+0x25a/frame 0xfe004b286ad0
amd64_syscall() at amd64_syscall+0x135/frame 0xfe004b286bf0
fast_syscall_common() at fast_syscall_common+0xf8/frame 0xfe004b286bf0
--- syscall (499, FreeBSD ELF64, sys_openat), rip = 0x805909caa, rsp =
0x7fff71a8, rbp = 0x7fff7220 ---
db>
```

Thanks,
---
YAMAMOTO Shigeru 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


zfs panic when 'make buildworld buildkernel'

2020-10-13 Thread YAMAMOTO Shigeru


Hi,

I try to 'make buildworld buildkernel' at full ZFS environment.
But I can't finished buildworld/buildkernel without panic.
Anyone have same trouble?

uname -a:
```
FreeBSD jenkins-02.current.os-hackers.jp 13.0-CURRENT FreeBSD 13.0-CURRENT
#0 r366657: Tue Oct 13 13:07:15 JST 2020
r...@jenkins-02.current.os-hackers.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
```

panic message:
```
login: panic: VERIFY(tid) failed

cpuid = 2
time = 1602582381
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame
0xfe002abaa9f0
vpanic() at vpanic+0x182/frame 0xfe002abaaa40
spl_panic() at spl_panic+0x3a/frame 0xfe002ab0
taskq_dispatch() at taskq_dispatch+0xe8/frame 0xfe002abaaae0
arc_prune_async() at arc_prune_async+0x3f/frame 0xfe002abaab00
arc_evict_cb() at arc_evict_cb+0x1f6/frame 0xfe002abaab60
zthr_procedure() at zthr_procedure+0x8f/frame 0xfe002abaabb0
fork_exit() at fork_exit+0x80/frame 0xfe002abaabf0
fork_trampoline() at fork_trampoline+0xe/frame 0xfe002abaabf0
--- trap 0, rip = 0, rsp = 0, rbp = 0 ---
KDB: enter: panic
[ thread pid 19 tid 100070 ]
Stopped at  kdb_enter+0x37: movq$0,0x10b0116(%rip)
db>
```

Latest stable kernel, I have, is:
```
FreeBSD jenkins-02.current.os-hackers.jp 13.0-CURRENT FreeBSD 13.0-CURRENT
#0 r363746: Sat Aug  1 14:25:06 JST 2020
r...@freebsd-00.current.os-hackers.jp:/usr/obj/usr/src/amd64.amd64/sys/GENERIC
amd64
```

Thanks,
---
YAMAMOTO Shigeru 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: RPI3-20200423-r360211.img.xz Not Boot On Raspberry Pi 4

2020-04-23 Thread YAMAMOTO Shigeru


Hi, all

>>>>> "ykla" == ykla   writes:
ykla> File FreeBSD-13.0-CURRENT-arm64-aarch64-RPI3-20200423-r360211.img.xz
ykla> not boot on raspberry pi 4, only shows me rainbow screen,and I
ykla> changed others u_boot.bin will panic.
ykla> *Here is my work but panic u_boot.bin show(not r360211 img,it's
ykla> *rainbow screen*):*

you need to copy 'u-boot.bin' for rpi4.

```
pkg install -y u-boot-rpi4
cp /usr/local/share/u-boot/u-boot-rpi4 /mnt/xxx
```

now rpi4 boot and I can use genet0.

```
[root@generic ~]# uname -a
FreeBSD generic 13.0-CURRENT FreeBSD 13.0-CURRENT #0 r360211: Thu Apr 23
08:12:13 UTC 2020
r...@releng1.nyi.freebsd.org:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC
arm64
[root@generic ~]#
```

```
genet0: flags=8843 metric 0 mtu 1500
options=68000b
ether dc:a6:32:70:c6:2b
inet6 fe80::dea6:32ff:fe70:c62b%genet0 prefixlen 64 scopeid 0x1
inet 10.206.131.114 netmask 0xfe00 broadcast 10.206.131.255
media: Ethernet autoselect (100baseTX )
status: active
nd6 options=23
lo0: flags=8049 metric 0 mtu 16384
options=680003
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2
inet 127.0.0.1 netmask 0xff00
groups: lo
nd6 options=21
[root@generic ~]#

```

Thanks,
---
YAMAMOTO Shigeru 
___
freebsd-current@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscr...@freebsd.org"


Re: quick hack to support option VIMAGE on USB Ethernet

2013-08-12 Thread YAMAMOTO Shigeru

Hi all,

From: Craig Rodrigues rodr...@freebsd.org
Subject: Re: quick hack to support option VIMAGE on USB Ethernet
Date: Mon, 12 Aug 2013 17:52:39 -0700
 I do not have a USB Ethernet device, and do not fully understand VIMAGE yet.
 Is your patch still necessary in CURRENT, after this patch was applied to
 subr_bus.c?
 
 http://lists.freebsd.org/pipermail/svn-src-all/2013-July/071878.html

I make a patch for r254236@HEAD which is newer than r253346.

My try is,
1) I try to enable option VIMAGE at r254236@HEAD.
It causes panic at accessing V_if_index in ifindex_alloc_locked().

2) I try to protect if_alloc(IFT_ETHER) at ue_attach_post_task() using
 CURVNET_SET_QUIET(curvnet) and CURVNET_RESTORE().
It causes abort at CURVNET_SET_QUIET() becasue curvnet is NULL.

3) I create my patch.
It is saving curvnet at uether_ifattach() and using saved curvnet at calling
CURVNET_SET_QUIET().
It seems me work.

Thanks,
---
YAMAMOTO Shigeru shig...@iij.ad.jp
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


quick hack to support option VIMAGE on USB Ethernet

2013-08-11 Thread YAMAMOTO Shigeru

Hi all,

I hope to use option VIMAGE on RaspberryPi.

So, I try to make a patch.
http://freebsd-current.os-hackers.jp/pub/FreeBSD/snapshots/20130812/raspberry-pi/patch-vimage-r254236.diff
#There is a SD image for RaspberryPi at same place.

But, I only test it for if_smsc driver on RaspberryPi.
I don't test other architectures/devices.

Please test my patch and suggest the way to support option VIMAGE on USB
devices, if you are interested in.

Thanks,
---
YAMAMOTO Shigeru shig...@iij.ad.jp
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [panic] currnet(r238089) cause panic when using '/usr/sbin/amd'

2012-07-06 Thread YAMAMOTO Shigeru

Hi all,

After my e-mail, some fixes for sys/amd64/amd64/pmapc. are commited.

I try to update newest current (r238163) and I hove no trouble.
My problem is fixed.

Thanks,
---
YAMAMOTO Shigeru
shig...@iij.ad.jp
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


[panic] currnet(r238089) cause panic when using '/usr/sbin/amd'

2012-07-04 Thread YAMAMOTO Shigeru

Hi all,

I try to update newest current (r238089).
I have kernel panic when using '/usr/sbin/amd'.

This kernel panic is not caused without using '/usr/sbin/amd'.
In old current (r236371), I have no problem with using '/usr/sbin/amd'.

Currently, I don't know how to fix it.
So I can only report this proble to ML.

Thanks,


How to repeat:
1) svn checkout r238089 source code
2) make buildworld and make buildkernel
3) make installworld and make installkernel
4) reboot
5) boot GENERIC kernel
6) run amd, /etc/rc.d/amd onestart


My environment:
- version is 10-current
 # uname -a
 FreeBSD venus.tokyo.iiji.jp 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r238089M: Wed 
Jul  4 10:30:01 JST 2012 
r...@venus.tokyo.iiji.jp:/usr/obj/usr/src/sys/GENERIC  amd64
- build by r238039 source code
- using GENERIC kernel
- load kernel modules are
 # kldstat
 Id Refs AddressSize Name
  1   19 0x8020 15d3ad0  kernel
  21 0x817d4000 22b260   zfs.ko
  32 0x81a0 8570 opensolaris.ko
  41 0x81c12000 38fc ums.ko
  51 0x81c16000 1b7a1ng_btsocket.ko
  61 0x81c32000 ba58 netgraph.ko
  71 0x81c3e000 118b ng_bluetooth.ko

---
YAMAMOTO Shigeru
shig...@iij.ad.jp
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


Re: [head tinderbox] failure on i386/pc98

2010-06-30 Thread YAMAMOTO Shigeru

 /src/sys/dev/ixgbe/ixgbe.h:385: error: duplicate member 'advertise'

'advertise' is added at r209607 and r209609.

please chone one of them.

Thanks,
---
YAMAMOTO Shigerushig...@iij.ad.jp
___
freebsd-current@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to freebsd-current-unsubscr...@freebsd.org


IPv6 patch for libradius

2003-03-14 Thread YAMAMOTO Shigeru

Hi all,

I make a patch to support IPv6 for libradius.

This is a quick hack.
Unfortunatly, I can't test it over IPv6 environment, only IPv4 environment.
Because, I don't have a RADIUS which supports IPv6 access.

This patch extents radius.conf(5) format.
 - specify 10 or more RADISU (original: up to 10)
 - specify IPv6 address (original: IPv4 only)
   ex.)
auth [2003:3:14::1]:1645 I can't see you 5 4
auth [2003:3:14::2]  $X*#..38947ax-+=
auth localhost   test teset

Please test it if you take interest in this patch.

Thanks,
---
YAMAMOTO Shigeru[EMAIL PROTECTED]
Index: radlib.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/lib/libradius/radlib.c,v
retrieving revision 1.10
diff -u -r1.10 radlib.c
--- radlib.c12 Jun 2002 00:21:07 -  1.10
+++ radlib.c10 Mar 2003 03:14:40 -
@@ -48,10 +48,10 @@
 static void clear_password(struct rad_handle *);
 static void generr(struct rad_handle *, const char *, ...)
__printflike(2, 3);
-static void insert_scrambled_password(struct rad_handle *, int);
-static void insert_request_authenticator(struct rad_handle *, int);
-static int  is_valid_response(struct rad_handle *, int,
-   const struct sockaddr_in *);
+static void insert_scrambled_password(struct rad_handle *, struct rad_server*);
+static void insert_request_authenticator(struct rad_handle *, struct rad_server*);
+static int  is_valid_response(struct rad_handle *, struct rad_server*,
+   const struct sockaddr *);
 static int  put_password_attr(struct rad_handle *, int,
const void *, size_t);
 static int  put_raw_attr(struct rad_handle *, int,
@@ -79,15 +79,13 @@
 }
 
 static void
-insert_scrambled_password(struct rad_handle *h, int srv)
+insert_scrambled_password(struct rad_handle* h, struct rad_server* server)
 {
MD5_CTX ctx;
unsigned char md5[16];
-   const struct rad_server *srvp;
int padded_len;
int pos;
 
-   srvp = h-servers[srv];
padded_len = h-pass_len == 0 ? 16 : (h-pass_len+15)  ~0xf;
 
memcpy(md5, h-request[POS_AUTH], LEN_AUTH);
@@ -96,7 +94,7 @@
 
/* Calculate the new scrambler */
MD5Init(ctx);
-   MD5Update(ctx, srvp-secret, strlen(srvp-secret));
+   MD5Update(ctx, server-secret, strlen(server-secret));
MD5Update(ctx, md5, 16);
MD5Final(md5, ctx);
 
@@ -113,19 +111,16 @@
 }
 
 static void
-insert_request_authenticator(struct rad_handle *h, int srv)
+insert_request_authenticator(struct rad_handle* h, struct rad_server* server)
 {
MD5_CTX ctx;
-   const struct rad_server *srvp;
-
-   srvp = h-servers[srv];
 
/* Create the request authenticator */
MD5Init(ctx);
MD5Update(ctx, h-request[POS_CODE], POS_AUTH - POS_CODE);
MD5Update(ctx, memset(h-request[POS_AUTH], 0, LEN_AUTH), LEN_AUTH);
MD5Update(ctx, h-request[POS_ATTRS], h-req_len - POS_ATTRS);
-   MD5Update(ctx, srvp-secret, strlen(srvp-secret));
+   MD5Update(ctx, server-secret, strlen(server-secret));
MD5Final(h-request[POS_AUTH], ctx);
 }
 
@@ -134,40 +129,48 @@
  * specified server.
  */
 static int
-is_valid_response(struct rad_handle *h, int srv,
-const struct sockaddr_in *from)
+is_valid_response(struct rad_handle* h, struct rad_server* server, const struct 
sockaddr* from)
 {
-   MD5_CTX ctx;
-   unsigned char md5[16];
-   const struct rad_server *srvp;
-   int len;
-
-   srvp = h-servers[srv];
+   int valid = 0;
 
/* Check the source address */
-   if (from-sin_family != srvp-addr.sin_family ||
-   from-sin_addr.s_addr != srvp-addr.sin_addr.s_addr ||
-   from-sin_port != srvp-addr.sin_port)
-   return 0;
-
-   /* Check the message length */
-   if (h-resp_len  POS_ATTRS)
-   return 0;
-   len = h-response[POS_LENGTH]  8 | h-response[POS_LENGTH+1];
-   if (len  h-resp_len)
-   return 0;
-
-   /* Check the response authenticator */
-   MD5Init(ctx);
-   MD5Update(ctx, h-response[POS_CODE], POS_AUTH - POS_CODE);
-   MD5Update(ctx, h-request[POS_AUTH], LEN_AUTH);
-   MD5Update(ctx, h-response[POS_ATTRS], len - POS_ATTRS);
-   MD5Update(ctx, srvp-secret, strlen(srvp-secret));
-   MD5Final(md5, ctx);
-   if (memcmp(h-response[POS_AUTH], md5, sizeof md5) != 0)
-   return 0;
+   if (from-sa_family == server-addr.ss_family  memcmp(from, (server-addr), 
from-sa_len) == 0) {
+   /* Check the message length */
+   if (h-resp_len  POS_ATTRS) {
+   valid = 0;
+   }
+   else {
+   int len;
+
+   len = h-response[POS_LENGTH]  8 | h-response[POS_LENGTH

small patch for controlling resolver information cache

2003-02-27 Thread YAMAMOTO Shigeru

Hi all,

I make a small patch for mobile users.
This patch is controlling cache of resolver information.

If seting 'RES_NOCACHE' to 'yes', any application reads /etc/resolv.conf at
any DNS quering.
I think, it is useful for using heavey network applications, such as
mozilla, in mobile environment.

Please try it if you want.

Thanks,
---
YAMAMOTO Shigeru[EMAIL PROTECTED]
cvs diff: Diffing .
Index: res_init.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/lib/libc/net/res_init.c,v
retrieving revision 1.30
diff -u -r1.30 res_init.c
--- res_init.c  25 Sep 2002 04:06:35 -  1.30
+++ res_init.c  25 Feb 2003 06:34:52 -
@@ -493,7 +493,12 @@
_res.options |= RES_NOALIASES;
else if ((cp = getenv(RES_OPTIONS)) != NULL)
res_setoptions(cp, env);
-   _res.options |= RES_INIT;
+   if (getenv(RES_NOCACHE) != NULL) {
+   _res.options = ~(RES_INIT);
+   }
+   else {
+   _res.options |= RES_INIT;
+   }
return (0);
 }
 


small patch to support Formula 2.5

2002-08-26 Thread YAMAMOTO Shigeru


Hi all,

I modify to support Formula 2.5 FireWire  USB on USB, which is a 2.5' ATA
disk case to attach on USB.
#URL:http://www.century.co.jp/products/cfc25fugkit.html (writen in Japanese)

This is quick hack.
I only test 'can mount it' and 'read a file'.
#I don't test 'can write a file'.

I send a patch.

Thanks,
---
YAMAMOTO Shigeru[EMAIL PROTECTED]


Index: sys/dev/usb/umass.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/usb/umass.c,v
retrieving revision 1.65
diff -u -r1.65 umass.c
--- sys/dev/usb/umass.c 8 Aug 2002 12:05:50 -   1.65
+++ sys/dev/usb/umass.c 26 Aug 2002 06:27:12 -
@@ -370,6 +370,11 @@
  FORCE_SHORT_INQUIRY
},
 
+   { USB_VENDOR_CENTURY, USB_PRODUCT_CENTURY_CFC25FUGKIT, RID_WILDCARD,
+ UMASS_PROTO_ATAPI | UMASS_PROTO_CBI_I,
+ NO_TEST_UNIT_READY | NO_START_STOP
+   },
+
{ VID_EOT, PID_EOT, RID_EOT, 0, 0 }
 };
 
Index: sys/dev/usb/usbdevs
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/usb/usbdevs,v
retrieving revision 1.101
diff -u -r1.101 usbdevs
--- sys/dev/usb/usbdevs 11 Aug 2002 21:11:14 -  1.101
+++ sys/dev/usb/usbdevs 26 Aug 2002 06:26:19 -
@@ -277,6 +277,7 @@
 vendor ARASAN  0x07da  Arasan Chip Systems
 vendor ALLIEDCABLE 0x07e6  Allied Cable
 vendor STSN0x07ef  STSN
+vendor CENTURY 0x07f7  Century Corporation
 vendor ZOOM0x0803  Zoom Telephonics
 vendor BROADLOGIC  0x0827  BroadLogic
 vendor HANDSPRING  0x082d  Handspring
@@ -1113,3 +1114,6 @@
 /* ZyXEL Communication Co. products */
 product ZYXEL OMNI56K  0x1500  Omni 56K Plus
 product ZYXEL 980N 0x2011  Scorpion-980N keyboard
+
+/* Century Corporation */
+product CENTURY CFC25FUGKIT0x000b  Formula 2.5 USB-ATAPI Bridge (CFC25FUG/KIT)



Re: Melco LPC4-CLX-CB support in 5.0-Current NEWCARD

2002-01-15 Thread YAMAMOTO Shigeru


 Shizuka == Shizuka Kudo [EMAIL PROTECTED] writes:
Shizuka Does anyone have tested whether this card works with current 5.0
Shizuka NEWCARD?

I already tested it on NEWCARD.

Melco LPC4-CLX-CB is using Realtek's chip.
So, we need to add vendor/device ID to rl driver if we want to use Melco
LPC4-CLX-CB.
#but rl driver is hang up when I testing it. does rl driver have bugs?

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message



patch to support sio with NEWCARD

2001-11-25 Thread YAMAMOTO Shigeru


Hi all,

I make a patch to support sio with NEWCARD.
This patch is to avoid ghost interrupt when a PC-Card was removed.

This patch has one assamption,
 - all Serial PC-Card have a 16450/16550 compatible interface.

I tested it on my NotePC and there is no problems.
Please try it if you have an interest.

Thanks,
---
YAMAMOTO Shigeru[EMAIL PROTECTED]


Index: sys/dev/sio/sio.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/sio/sio.c,v
retrieving revision 1.352
diff -u -r1.352 sio.c
--- sys/dev/sio/sio.c   24 Oct 2001 18:30:04 -  1.352
+++ sys/dev/sio/sio.c   23 Nov 2001 10:41:30 -
@@ -1466,7 +1466,24 @@
com = (struct com_s *)arg;
 
mtx_lock_spin(sio_lock);
-   siointr1(com);
+   while (!com-gone) {
+   u_int8_tiir = 0;
+
+   iir = inb(com-int_id_port);
+/*
+printf(__FUNCTION__ :%d: iir = 0x%x\n, __LINE__, iir);
+*/
+   if (iir != 0xFF) {
+   siointr1(com);
+   if ((iir  IIR_IMASK) == IIR_NOPEND) {
+   break;
+   }
+   }
+   else {
+printf(__FUNCTION__ :%d: maybe, card was remoted\n, __LINE__);
+   break;
+   }
+   }
mtx_unlock_spin(sio_lock);
 #else /* COM_MULTIPORT */
bool_t  possibly_more_intrs;
@@ -1483,6 +1500,8 @@
do {
possibly_more_intrs = FALSE;
for (unit = 0; unit  sio_numunits; ++unit) {
+   u_int8_tiir = 0;
+
com = com_addr(unit);
/*
 * XXX COM_LOCK();
@@ -1490,8 +1509,9 @@
 */
if (com != NULL 
 !com-gone
-(inb(com-int_id_port)  IIR_IMASK)
-  != IIR_NOPEND) {
+((iir = inb(com-int_id_port))  IIR_IMASK)
+  != IIR_NOPEND
+iir != 0xFF) {
siointr1(com);
possibly_more_intrs = TRUE;
}
@@ -1530,9 +1550,8 @@
}
}
line_status = inb(com-line_status_port);
-
/* input event? (check first to help avoid overruns) */
-   while (line_status  LSR_RCV_MASK) {
+   while ((line_status  LSR_RCV_MASK)) {
/* break/unnattached error bits or real input? */
if (!(line_status  LSR_RXRDY))
recv_data = 0;
@@ -1718,10 +1737,12 @@
}
}
 
+#if0
/* finished? */
 #ifndef COM_MULTIPORT
if ((inb(com-int_id_port)  IIR_IMASK) == IIR_NOPEND)
 #endif /* COM_MULTIPORT */
+#endif
return;
}
 }
Index: sys/dev/sio/sio_pccard.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/sio/sio_pccard.c,v
retrieving revision 1.1
diff -u -r1.1 sio_pccard.c
--- sys/dev/sio/sio_pccard.c23 Oct 2001 15:17:33 -  1.1
+++ sys/dev/sio/sio_pccard.c24 Nov 2001 05:29:25 -
@@ -40,18 +40,28 @@
 #include machine/resource.h
 #include sys/timepps.h
 
+#include dev/pccard/pccardreg.h
+#include dev/pccard/pccardvar.h
+#include dev/pccard/pccarddevs.h
+
 #include dev/sio/siovar.h
 
-static int sio_pccard_attach __P((device_t dev));
-static int sio_pccard_detach __P((device_t dev));
-static int sio_pccard_probe __P((device_t dev));
+static int sio_pccard_match__P((device_t self));
+static int sio_pccard_probe__P((device_t self));
+static int sio_pccard_attach   __P((device_t self));
+static int sio_pccard_detach   __P((device_t self));
 
 static device_method_t sio_pccard_methods[] = {
/* Device interface */
-   DEVMETHOD(device_probe, sio_pccard_probe),
-   DEVMETHOD(device_attach,sio_pccard_attach),
+   DEVMETHOD(device_probe, pccard_compat_probe),
+   DEVMETHOD(device_attach,pccard_compat_attach),
DEVMETHOD(device_detach,sio_pccard_detach),
 
+   /* Card interface */
+   DEVMETHOD(card_compat_match,sio_pccard_match),
+   DEVMETHOD(card_compat_probe,sio_pccard_probe),
+   DEVMETHOD(card_compat_attach,   sio_pccard_attach),
+
{ 0, 0 }
 };
 
@@ -61,27 +71,53 @@
sizeof(struct com_s),
 };
 
-static int
-sio_pccard_probe(dev)
-   device_tdev;
-{
+static
+int
+sio_pccard_match(device_t self) {
+   int error = 0;
+   u_int32_t   fcn = PCCARD_FUNCTION_UNSPEC;
+
+   error = pccard_get_function(self, fcn);
+   if (!error

2 patches for NEWCARD

2001-11-19 Thread YAMAMOTO Shigeru


Hi all,

I make 2 patches for NEWCARD.
one is to supoort to suspend/resume PC Card devices on NEWCARD.
other is to ignore ghost interrupt at ed driver when removing PC Card.

It is a quick hack and I only tested on my NotePC, Sony VAIO 818.
So I don't know my patches work fine on other NotePC.

Please try if you have interest to my patches.
Thanks,

---
YAMAMOTO Shigeru[EMAIL PROTECTED]


Index: sys/dev/pccbb/pccbb.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/pccbb/pccbb.c,v
retrieving revision 1.27
diff -u -r1.27 pccbb.c
--- sys/dev/pccbb/pccbb.c   3 Nov 2001 16:45:31 -   1.27
+++ sys/dev/pccbb/pccbb.c   18 Nov 2001 19:37:52 -
@@ -2096,14 +2096,112 @@
b, s, f, reg, val, width);
 }
 
+static
+int
+pccbb_suspend(device_t dev) {
+   int error = 0;
+   struct pccbb_softc* sc = device_get_softc(dev);
+   int numdevs;
+   device_t*   devlist;
+   int tmp;
+
+   bus_teardown_intr(dev, sc-sc_irq_res, sc-sc_intrhand);
+
+   device_get_children(dev, devlist, numdevs);
+
+   error = 0;
+   for (tmp = 0; tmp  numdevs; tmp++) {
+   if (device_detach(devlist[tmp]) == 0) {
+   device_delete_child(dev, devlist[tmp]);
+   }
+   else {
+   error++;
+   }
+   }
+   free(devlist, M_TEMP);
+   if (error  0) {
+   return ENXIO;
+   }
+
+   sc-sc_cbdev = NULL;
+   sc-sc_pccarddev = NULL;
+
+   return(error);
+}
+
+static
+int
+pccbb_resume(device_t self)
+{
+   int error = 0;
+   struct pccbb_softc *sc = (struct pccbb_softc *)device_get_softc(self);
+
+   pci_write_config(self, PCCBBR_SOCKBASE,
+   rman_get_start(sc-sc_base_res), 4);
+   DEVPRINTF((self, PCI Memory allocated: %08lx\n,
+   rman_get_start(sc-sc_base_res)));
+
+   pccbb_chipinit(sc);
+
+   /* CSC Interrupt: Card detect interrupt on */
+   sc-sc_socketreg-socket_mask |= PCCBB_SOCKET_MASK_CD;
+
+   /* reset interrupt */
+   {
+   u_int32_t tmp;
+
+   tmp = sc-sc_socketreg-socket_event;
+   sc-sc_socketreg-socket_event = tmp;
+   }
+
+   /* establish the interrupt. */
+   if (bus_setup_intr(self, sc-sc_irq_res, INTR_TYPE_BIO, pccbb_intr, sc,
+   (sc-sc_intrhand))) {
+   device_printf(self, couldn't establish interrupt);
+   bus_release_resource(self, SYS_RES_IRQ, 0, sc-sc_irq_res);
+   bus_release_resource(self, SYS_RES_MEMORY, PCCBBR_SOCKBASE,
+   sc-sc_base_res);
+   mtx_destroy(sc-sc_mtx);
+   error = ENOMEM;
+   }
+
+   /* attach children */
+   if (!error) {
+   sc-sc_cbdev = device_add_child(self, cardbus, -1);
+   if (sc-sc_cbdev == NULL)
+   DEVPRINTF((self, WARNING: cannot add cardbus bus.\n));
+   else if (device_probe_and_attach(sc-sc_cbdev) != 0) {
+   DEVPRINTF((self, WARNING: cannot attach cardbus bus!\n));
+   sc-sc_cbdev = NULL;
+   }
+
+   sc-sc_pccarddev = device_add_child(self, pccard, -1);
+   if (sc-sc_pccarddev == NULL)
+   DEVPRINTF((self, WARNING: cannot add pccard bus.\n));
+   else if (device_probe_and_attach(sc-sc_pccarddev) != 0) {
+   DEVPRINTF((self, WARNING: cannot attach pccard bus.\n));
+   sc-sc_pccarddev = NULL;
+   }
+   }
+
+   /* wakeup thread */
+   if (!error) {
+   mtx_lock(sc-sc_mtx);
+   wakeup(sc);
+   mtx_unlock(sc-sc_mtx);
+   }
+
+   return(error);
+}
+
 static device_method_t pccbb_methods[] = {
/* Device interface */
DEVMETHOD(device_probe, pccbb_probe),
DEVMETHOD(device_attach,pccbb_attach),
DEVMETHOD(device_detach,pccbb_detach),
DEVMETHOD(device_shutdown,  pccbb_shutdown),
-   DEVMETHOD(device_suspend,   bus_generic_suspend),
-   DEVMETHOD(device_resume,bus_generic_resume),
+   DEVMETHOD(device_suspend,   pccbb_suspend),
+   DEVMETHOD(device_resume,pccbb_resume),
 
/* bus methods */
DEVMETHOD(bus_print_child,  bus_generic_print_child),


Index: sys/dev/ed/if_ed.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/dev/ed/if_ed.c,v
retrieving revision 1.206
diff -u -r1.206 if_ed.c
--- sys/dev/ed/if_ed.c  4 Nov 2001 22:56:20 -   1.206
+++ sys/dev/ed/if_ed.c  11 Nov 2001 15:25:52 -

patch for wi driver

2000-12-11 Thread YAMAMOTO Shigeru

Hi, all.
I send a patch for wi driver.

Some cases, we have errors,
'wi0: tx buffer allocation failed'
and
'wi0: mgmt. buffer allocation failed'

Thease errors are caused by bugs in wi driver.
#Current wi driver has initialization and resource allocation mistakes.

And this patch includes WEP support code for PrismII chip.
Original WEP support code was writen by Onoe at NetBSD.
But WEP support code does not work many PrismII based cards on FreeBSD.
We need more hack.

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.


Index: if_wi.c
===
RCS file: /share/cvsup/FreeBSD/current/usr/src/sys/i386/isa/if_wi.c,v
retrieving revision 1.29
diff -u -r1.29 if_wi.c
--- if_wi.c 2000/11/30 18:52:31 1.29
+++ if_wi.c 2000/12/11 04:46:37
@@ -231,10 +231,34 @@
struct wi_ltv_gen   gen;
struct ifnet*ifp;
int error;
+   u_int32_t   flags;
 
sc = device_get_softc(dev);
ifp = sc-arpcom.ac_if;
 
+   /*
+*  XXX: quick hack to support Prism II chip.
+*  Currently, we need to set a flags in pccard.conf to specify
+*  which type chip is used.
+*
+*  We need to replace this code in a future.
+*  It is better to use CIS than using a flag.
+*/
+   flags = device_get_flags(dev);
+#defineWI_FLAGS_PRISM2 0x1
+   if (flags  WI_FLAGS_PRISM2) {
+   sc-wi_prism2 = 1;
+   if (bootverbose) {
+   device_printf(dev, "found PrismII chip\n");
+   }
+   }
+   else {
+   sc-wi_prism2 = 0;
+   if (bootverbose) {
+   device_printf(dev, "found Lucent chip\n");
+   }
+   }
+
error = wi_alloc(dev);
if (error) {
device_printf(dev, "wi_alloc() failed! (%d)\n", error);
@@ -320,6 +344,12 @@
wi_read_record(sc, gen);
sc-wi_has_wep = gen.wi_val;
 
+   if (bootverbose) {
+   device_printf(sc-dev,
+   __FUNCTION__ ":wi_has_wep = %d\n",
+   sc-wi_has_wep);
+   }
+
bzero((char *)sc-wi_stats, sizeof(sc-wi_stats));
 
wi_init(sc);
@@ -589,7 +619,21 @@
 {
int i, s = 0;
 
+   /* wait for the busy bit to clear */
+   for (i = 0; i  WI_TIMEOUT; i++) {
+   if (!(CSR_READ_2(sc, WI_COMMAND)  WI_CMD_BUSY)) {
+   break;
+   }
+   DELAY(10*1000); /* 10 m sec */
+   }
+
+   if (i == WI_TIMEOUT) {
+   return(ETIMEDOUT);
+   }
+
CSR_WRITE_2(sc, WI_PARAM0, val);
+   CSR_WRITE_2(sc, WI_PARAM1, 0);
+   CSR_WRITE_2(sc, WI_PARAM2, 0);
CSR_WRITE_2(sc, WI_COMMAND, cmd);
 
for (i = 0; i  WI_TIMEOUT; i++) {
@@ -621,11 +665,12 @@
 static void wi_reset(sc)
struct wi_softc *sc;
 {
+#ifdef foo
wi_cmd(sc, WI_CMD_INI, 0);
DELAY(10);
wi_cmd(sc, WI_CMD_INI, 0);
+#endif
DELAY(10);
-#ifdef foo
if (wi_cmd(sc, WI_CMD_INI, 0))
device_printf(sc-dev, "init failed\n");
CSR_WRITE_2(sc, WI_INT_EN, 0);
@@ -633,7 +678,7 @@
 
/* Calibrate timer. */
WI_SETVAL(WI_RID_TICK_TIME, 8);
-#endif
+
return;
 }
 
@@ -646,6 +691,23 @@
 {
u_int16_t   *ptr;
int i, len, code;
+   struct wi_ltv_gen   *oltv, p2ltv;
+
+   oltv = ltv;
+   if (sc-wi_prism2) {
+   switch (ltv-wi_type) {
+   case WI_RID_ENCRYPTION:
+   p2ltv.wi_type = WI_RID_P2_ENCRYPTION;
+   p2ltv.wi_len = 2;
+   ltv = p2ltv;
+   break;
+   case WI_RID_TX_CRYPT_KEY:
+   p2ltv.wi_type = WI_RID_P2_TX_CRYPT_KEY;
+   p2ltv.wi_len = 2;
+   ltv = p2ltv;
+   break;
+   }
+   }
 
/* Tell the NIC to enter record read mode. */
if (wi_cmd(sc, WI_CMD_ACCESS|WI_ACCESS_READ, ltv-wi_type))
@@ -675,6 +737,35 @@
for (i = 0; i  ltv-wi_len - 1; i++)
ptr[i] = CSR_READ_2(sc, WI_DATA1);
 
+   if (sc-wi_prism2) {
+   switch (oltv-wi_type) {
+   case WI_RID_TX_RATE:
+   case WI_RID_CUR_TX_RATE:
+   switch (ltv-wi_val) {
+   case 1: oltv-wi_val = 1; break;
+   case 2: oltv-wi_val = 2; break;
+   case 3: oltv-wi_val = 6; break;
+   case 4: oltv-wi_val = 5; break;
+   case 7: oltv-wi_val = 7; break

snapshot of CardBus support code for FreeBSD

2000-06-27 Thread YAMAMOTO Shigeru


Hi all,

I'm writing a code to support CardBus at FreeBSD.
I put on a current working code snapshot at my Web,
URL:http://www.bremen.or.jp/shigeru/FreeBSD/CardBus/

This is an alpha quality and different implimentation of NEWCARD.
Currently, It only works on my laptop, SONY VAIO PCG-818.
Supported PC Cards are MELCO WLI-PCM-L11, which is an OEM of a Lucent
WaveLan, and Corega FastEther PCC-TX.
These 16-bit PC Cards are using PCI interrupt, not use ISA interrupt.
CardBus PC Card does not work, we can only dump a CIS.

I put on a compiled kernel at same place.
#Please try it if you want.

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



Re: CardBus in current??

2000-02-29 Thread YAMAMOTO Shigeru


 "Warner" == Warner Losh Warner writes:
Warner It will likely be in 4.1 (the 1480A is likely one of the first ones
Warner to be supported).  4.2 will have more support.
Warner All of this assumes that I get the time to work on this.

Who works for CardBus support work?
Does Warner only work for CardBus support work?

I'm writing a code for CardBus work.
#Warner knows I'm writing a code.

Currenlty, my code only supports a Ricoh Rx5c478 chipset, does not attach
any card driver, only dumps a first CIS tuple chain when a 32bit/16bit card
is installed.
A snapshot of my code is
http://www.bremen.or.jp/shigeru/FreeBSD/CardBus/

Where is a best place to discass CardBus work?
-current?, -mobile?, -hackers?, etc...

Thanks,
---
YAMAMOTO Shigeru[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



which is right? 'controller pcic0 at isa?' or 'device pcic0 at isa?'?

1999-12-09 Thread YAMAMOTO Shigeru


I wonder about configuration for pcic in -current.

In GENERIC, '#device pcic0 at isa?'
In LINT and PCCARD, 'controller pcic0 at isa?'

Which is right?

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



why 'The legacy aout build' was removed from current ?

1999-12-08 Thread YAMAMOTO Shigeru


In a log of @src/Makefile, revision 1.230,

o  The legacy aout build has been removed.

Why 'The legacy aout build' was removed from current?

Are we now living in the TRUE ELF world?

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message



how to allocate a resource at new-bus architecture?

1999-10-18 Thread YAMAMOTO Shigeru


Hi, all.
I have a question about a resource allocation at a child device of PCI
device.

I'm thinking about to write a CardBud device driver.
CardBus is attached at PCI bus.
So I think CardBus is a child device of PCI device.

Before revision 1.122 of @src/sys/pci/pci.c, I can allocate a resouce when
I set rid 0 and call bus_alloc_resource().
CardBus driver is a child of PCI driver, so bus_alloc_resource(), called at
CardBus driver, call pci_alloc_resource().
When rid == 0, pci_alloc_resource() call an resource allocation method of
parent bus.

But revision 1.122 or later, pci_alloc_resource() was rewritten very simply.
pci_alloc_resource() only call resource_list_alloc() and
resource_list_alloc() returns 0 when requested resource is not registered
nor reserved.
It seems me new PCI driver assume all resources are assigned by BIOS.
But a BIOS of my notebood, VAIO 818/Phoenix BIOS, does not assign a resource
for a CardBus socket/ExCA base address register.
#of cource, I set a BIOS as 'Plug  Play O/S: No'.
I can't allocate a resource using bus_alloc_resource().

How to allocate a resource for a device which resources are not assigned by
BIOS?
What is a right way to allocate a resource in a new-bus device driver?

Thanks,
---
YAMAMOTO ShigeruInternet Initiative Japan Inc.
[EMAIL PROTECTED] Network Engineering Div.


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message