com(4) for macppc, testers needed

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

com(4) for macppc, testers needed

Felix Kronlage-2
Hi,

wanted to ask if anyone with a com(4)-based device, like
a pcmcia gprs/umts card that has serial devices on it and works
with com(4) could give the attached diff a spin on macppc.

nothing fancy, it enables the com(4) driver on macppc and add's
a bit to com.c in order to prevent a panic if the device is
removed while there are still references to it.

all the gory details can be found here:
<url: http://hazardous.org/~fkr/openbsd/openbsd_gprs_umts.html>

I've successfully got my Siemens Connect2Air CF GPRS and
Novatel Wireless U530 cards working with it and have been using
these since December on a daily basis.

Mickey and Dale helped me with this. Dale also provided the diff
to the MAKEDEV script.

thanks,
felix
--
GPG/PGP:   D9AC74D0 / 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0
http://hazardous.org/~fkr - [hidden email] - fkr@silc|irc -  FKR-RIPE
https://www.bytemine.net/ - bytemine - BSD based hosting/solutions/ideas

com_changes.diff (3K) Download Attachment
attachment1 (194 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: com(4) for macppc, testers needed

Felix Kronlage-2
On Thu, Feb 16, 2006 at 09:57:32PM +0100, Felix Kronlage wrote:

> wanted to ask if anyone with a com(4)-based device, like
> a pcmcia gprs/umts card that has serial devices on it and works
> with com(4) could give the attached diff a spin on macppc.

ugh, forgot this (martin reminded me off-list).
add this to the kernel config file:

com*    at pcmcia?

Due to the hardware I have (or not have) I've so far only
tested it with a pcmcia based com(4) port. (as soon, as I
get this Ericsson GC89 working a bit more, I can test it
with a cardbus based com(4) port as well)

felix
--
GPG/PGP:   D9AC74D0 / 076E 1E87 3E05 1C7F B1A0  8A48 0D31 9BD3 D9AC 74D0
http://hazardous.org/~fkr - [hidden email] - fkr@silc|irc -  FKR-RIPE
https://www.bytemine.net/ - bytemine - BSD based hosting/solutions/ideas
Index: sys/arch/macppc/conf/GENERIC
===================================================================
RCS file: /src/openbsd//src/sys/arch/macppc/conf/GENERIC,v
retrieving revision 1.126
diff -u -r1.126 GENERIC
--- sys/arch/macppc/conf/GENERIC 11 Feb 2006 01:32:03 -0000 1.126
+++ sys/arch/macppc/conf/GENERIC 16 Feb 2006 22:37:02 -0000
@@ -283,6 +283,7 @@
 #rl* at cardbus? # RealTek 81[23]9 ethernet
 rtw* at cardbus? # Realtek 8180
 wdc* at pcmcia?
+com* at pcmcia?
 
 wsdisplay* at vgafb?

Reply | Threaded
Open this post in threaded view
|

Re: com(4) for macppc, testers needed

Felix Kronlage-2
In reply to this post by Felix Kronlage-2
now the complete diff, including the bit for GENERIC and
for share/man/man4/com.4

felix
--
Felix Kronlage                Tel:     (+49)(0)441 - 36116410
[hidden email]         Fax:     (+49)(0)441 - 36116419
http://www.bytemine.net/      PGP/GPG:             0xD9AC74D0
bytemine  -  Entwicklungsmanufaktur fuer innovative Loesungen
Index: sys/dev/ic/com.c
===================================================================
RCS file: /src/openbsd/src/sys/dev/ic/com.c,v
retrieving revision 1.109
diff -u -r1.109 com.c
--- sys/dev/ic/com.c 1 Jan 2006 11:59:40 -0000 1.109
+++ sys/dev/ic/com.c 8 Feb 2006 14:19:24 -0000
@@ -207,6 +207,8 @@
  struct com_softc *sc = (struct com_softc *)self;
  int maj, mn;
 
+ sc->sc_swflags |= COM_SW_DEAD;
+
  /* locate the major number */
  for (maj = 0; maj < nchrdev; maj++)
  if (cdevsw[maj].d_open == comopen)
@@ -500,6 +502,9 @@
  if (!ISSET(tp->t_state, TS_ISOPEN))
  return 0;
 #endif
+
+ if(sc->sc_swflags & COM_SW_DEAD)
+ return 0;
 
  (*linesw[tp->t_line].l_close)(tp, flag);
  s = spltty();
Index: sys/dev/ic/comvar.h
===================================================================
RCS file: /src/openbsd/src/sys/dev/ic/comvar.h,v
retrieving revision 1.37
diff -u -r1.37 comvar.h
--- sys/dev/ic/comvar.h 24 Oct 2005 14:22:34 -0000 1.37
+++ sys/dev/ic/comvar.h 29 Dec 2005 14:12:13 -0000
@@ -117,6 +117,7 @@
 #define COM_SW_CRTSCTS 0x04
 #define COM_SW_MDMBUF 0x08
 #define COM_SW_PPS 0x10
+#define COM_SW_DEAD 0x20
  int sc_fifolen;
  u_char sc_msr, sc_mcr, sc_lcr, sc_ier;
  u_char sc_dtr;
Index: sys/arch/macppc/macppc/conf.c
===================================================================
RCS file: /src/openbsd/src/sys/arch/macppc/macppc/conf.c,v
retrieving revision 1.27
diff -u -r1.27 conf.c
--- sys/arch/macppc/macppc/conf.c 16 Nov 2005 03:43:40 -0000 1.27
+++ sys/arch/macppc/macppc/conf.c 29 Dec 2005 15:58:29 -0000
@@ -95,6 +95,9 @@
 cdev_decl(kbd);
 cdev_decl(ms);
 
+#include "com.h"
+cdev_decl(com);
+
 #include "wsdisplay.h"
 #include "wskbd.h"
 #include "wsmouse.h"
@@ -173,8 +176,8 @@
  cdev_bpftun_init(NBPFILTER,bpf),/* 22: berkeley packet filter */
  cdev_bpftun_init(NTUN,tun), /* 23: network tunnel */
  cdev_lkm_init(NLKM,lkm), /* 24: loadable module driver */
-        cdev_apm_init(NAPM,apm), /* 25: APM interface */
- cdev_notdef(), /* 26 */
+ cdev_apm_init(NAPM,apm), /* 25: APM interface */
+ cdev_tty_init(NCOM,com),        /* 26: Serial Ports via com(4) */
  cdev_notdef(), /* 27 */
  cdev_notdef(), /* 28 */
  cdev_notdef(), /* 29 */
@@ -341,6 +344,7 @@
 cons_decl(ws);
 cons_decl(zs);
 cons_decl(ofc);
+cons_decl(com);
 
 struct consdev constab[] = {
 #if NWSDISPLAY > 0
Index: sys/arch/macppc/conf/GENERIC
===================================================================
RCS file: /src/openbsd/src/sys/arch/macppc/conf/GENERIC,v
retrieving revision 1.126
diff -u -r1.126 GENERIC
--- sys/arch/macppc/conf/GENERIC 11 Feb 2006 01:32:03 -0000 1.126
+++ sys/arch/macppc/conf/GENERIC 16 Feb 2006 22:37:02 -0000
@@ -283,6 +283,7 @@
 #rl* at cardbus? # RealTek 81[23]9 ethernet
 rtw* at cardbus? # Realtek 8180
 wdc* at pcmcia?
+com* at pcmcia?
 
 wsdisplay* at vgafb?
 
Index: etc/etc.macppc/MAKEDEV.md
===================================================================
RCS file: /src/openbsd/src/etc/etc.macppc/MAKEDEV.md,v
retrieving revision 1.22
diff -u -r1.22 MAKEDEV.md
--- etc/etc.macppc/MAKEDEV.md 16 Nov 2005 03:44:12 -0000 1.22
+++ etc/etc.macppc/MAKEDEV.md 8 Feb 2006 14:18:00 -0000
@@ -49,6 +49,13 @@
 _DEV(wsmouse, 69)
 _TITLE(usb)
 _DEV(uall)
+__devitem(ttyS, ttyS*, com serial ports,com)dnl
+_mkdev({-ttyS-}, {-ttyS[0-9a-zA-Z]-}, {-S=${i#ttyS*}
+        o=$(alph2d $U)
+       M ttyS$S c major_ttyS_c $o 660 dialer uucp
+       M cuaS$S c major_ttyS_c Add($o, 128) 660 dialer uucp-})dnl
+
+_DEV(ttyS, 26)
 _DEV(ttyU, 66)
 _DEV(ugen, 63)
 _DEV(uhid, 62)
@@ -103,6 +110,7 @@
 target(all, vnd, 0, 1, 2, 3)dnl
 target(all, ccd, 0, 1, 2, 3)dnl
 target(all, gpio, 0, 1, 2)dnl
+target(all, ttyS, 0, 1)dnl
 target(ramd, sd, 0, 1, 2, 3, 4)dnl
 target(ramd, wd, 0, 1, 2, 3, 4)dnl
 target(ramd, st, 0, 1)dnl
Index: share/man/man4/com.4
===================================================================
RCS file: /src/openbsd/src/share/man/man4/com.4,v
retrieving revision 1.24
diff -u -r1.24 com.4
--- share/man/man4/com.4 10 Sep 2005 19:05:32 -0000 1.24
+++ share/man/man4/com.4 30 Dec 2005 13:37:34 -0000
@@ -70,6 +70,9 @@
 .Cd "com2 at gsc? irq 13"
 .Cd "com1 at dino? irq 11"
 .Pp
+.Cd "# macppc"
+.Cd "com* at pcmcia?"
+.Pp
 .Cd "# sparc"
 .Cd "com* at obio?                            " Pq "built-in modem on SPARCbook"
 .Pp

Reply | Threaded
Open this post in threaded view
|

Re: com(4) for macppc, testers needed

Antoine Jacoutot
In reply to this post by Felix Kronlage-2
Selon Felix Kronlage <[hidden email]>:
> wanted to ask if anyone with a com(4)-based device, like
> a pcmcia gprs/umts card that has serial devices on it and works

Does it means RCT pcmcia/cardbus modems might be supported as well ?
If so, I might buy one and do some tests, I'd really like to be able to use a
modem with my Powerbook.

--
Antoine

Reply | Threaded
Open this post in threaded view
|

Re: com(4) for macppc, testers needed

Felix Kronlage-2
On Sat, Feb 18, 2006 at 09:17:43AM +0100, Antoine Jacoutot wrote:

> > wanted to ask if anyone with a com(4)-based device, like
> > a pcmcia gprs/umts card that has serial devices on it and works
> Does it means RCT pcmcia/cardbus modems might be supported as well ?

if those cards work with the com(4) driver on other openbsd architectures
(like i386), i'd think so. (naive as I am :)

felix