From owner-freebsd-ports Sun Sep 30 3:10:17 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 2ACD537B40B for ; Sun, 30 Sep 2001 03:10:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f8UAA5227156; Sun, 30 Sep 2001 03:10:05 -0700 (PDT) (envelope-from gnats) Received: from hand.dotat.at (host217-35-36-79.in-addr.btopenworld.com [217.35.36.79]) by hub.freebsd.org (Postfix) with ESMTP id 3298D37B408 for ; Sun, 30 Sep 2001 03:07:14 -0700 (PDT) Received: from fanf by hand.dotat.at with local (Exim 3.33 #2) id 15ndV6-0000Hr-00 for FreeBSD-gnats-submit@freebsd.org; Sun, 30 Sep 2001 10:07:08 +0000 Message-Id: Date: Sun, 30 Sep 2001 10:07:08 +0000 From: Tony Finch Reply-To: Tony Finch To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/30929: [net/pppoa] use usbd to initialize USB ADSL modem Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 30929 >Category: ports >Synopsis: [net/pppoa] use usbd to initialize USB ADSL modem >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Sep 30 03:10:05 PDT 2001 >Closed-Date: >Last-Modified: >Originator: Tony Finch >Release: FreeBSD 4.4-STABLE-20010929 i386 >Organization: dotat labs >Environment: System: FreeBSD hand.dotat.at 4.4-STABLE-20010929 FreeBSD 4.4-STABLE-20010929 #8: Sat Sep 29 05:23:12 GMT 2001 fanf@hand.dotat.at:/FreeBSD/obj/FreeBSD/releng4/sys/SHARP i386 >Description: Instead of blindly running the ADSL modem drivers at startup, these files configure usbd to run them whenever the modem is plugged in. It doesn't kill them automatically when the modem is unplugged because it is much safer to manually kill them first. I also include some relevant bits of my ppp configuration which handles bringing NAT and packet forwarding up and down gracefully. >How-To-Repeat: >Fix: # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # etc/usbd.conf.patch # etc/usb_adsl # etc/ppp/adsl-ppp.conf # etc/ppp/adsl-ppp.linkdown # etc/ppp/adsl-ppp.linkup # echo x - etc/usbd.conf.patch sed 's/^X//' >etc/usbd.conf.patch << 'END-of-etc/usbd.conf.patch' XIndex: usbd.conf X=================================================================== XRCS file: /home/fanf/cvs/etc/usbd.conf,v Xretrieving revision 1.1 Xretrieving revision 1.3 Xdiff -u -r1.1 -r1.3 X--- usbd.conf 2001/09/01 13:59:14 1.1 X+++ usbd.conf 2001/09/19 00:49:36 1.3 X@@ -38,6 +38,15 @@ X devname "ums[0-9]+" X attach "/usr/sbin/moused -p /dev/${DEVNAME} -I /var/run/moused.${DEVNAME}.pid" X X+# The entry below initializes the modem and starts the PPP over ATM X+# implementation. X+# X+device "ALCATEL Speed Touch USB" X+ vendor 0x06b9 X+ product 0x4061 X+ release 0x0000 X+ attach "/etc/usb_adsl start" X+ X # The fallthrough entry: Nothing is specified, nothing is done. And it isn't X # necessary at all :-). Just for pretty printing in debugging mode. X # END-of-etc/usbd.conf.patch echo x - etc/usb_adsl sed 's/^X//' >etc/usb_adsl << 'END-of-etc/usb_adsl' X#!/bin/sh X# X# usb_adsl: initialize ALCATEL Speed Touch USB ADSL modem X# X# $Version: etc/usb_adsl,v 1.10 2001/09/30 07:28:12 fanf Exp $ X Xstartstop=$1 Xshift X X# allow us to find modem driver programs XPATH="/usr/local/sbin:/usr/local/bin:$PATH" X Xfirmware=/usr/local/libdata/mgmt.o X Xcase ${startstop} in X[Ss][Tt][Aa][Rr][Tt]) X { modem_run -f ${firmware} -v 1 -m X ppp -ddial adsl nat X } 2>&1 | logger -t usb_adsl -i & X ;; X[Ss][Tt][Oo][Pp]) X killall ppp X killall modem_run X ;; X*) X echo "$0: usage: $0 " X exit 1 X ;; Xesac END-of-etc/usb_adsl echo x - etc/ppp/adsl-ppp.conf sed 's/^X//' >etc/ppp/adsl-ppp.conf << 'END-of-etc/ppp/adsl-ppp.conf' X# ppp.conf fragment for Alcatel Speed Touch USB ADSL modem X Xnat: X nat enable yes X nat deny_incoming yes X nat use_sockets yes X enable iface-alias X Xadsl: X set speed sync X set device !"pppoa2m -vpi 0 -vci 38 -v 1" X set authname USERNAME X set authkey PASSWORD END-of-etc/ppp/adsl-ppp.conf echo x - etc/ppp/adsl-ppp.linkdown sed 's/^X//' >etc/ppp/adsl-ppp.linkdown << 'END-of-etc/ppp/adsl-ppp.linkdown' X# disable packet forwarding when PPP stops doing NAT X Xnat: X shell sysctl -w net.inet.ip.forwarding=0 END-of-etc/ppp/adsl-ppp.linkdown echo x - etc/ppp/adsl-ppp.linkup sed 's/^X//' >etc/ppp/adsl-ppp.linkup << 'END-of-etc/ppp/adsl-ppp.linkup' X# enable packet forwarding when PPP is doing NAT X Xnat: X shell sysctl -w net.inet.ip.forwarding=1 END-of-etc/ppp/adsl-ppp.linkup exit >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message