1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-19 19:59:43 +00:00

FreeBSD driver for newer Option HSDPA USB dongles.

The driver have been tested with the following devices

  * Option GlobeSurfer iCON 7.2 (2.4.6Hd firmware)
  * Option GlobeSurfer iCON 225

Older cards should work just fine with ubsa(4) or any similar
USB-over-serial driver.

Note that this driver should be considered beta.

WWW: http://www.shapeshifter.se/code/hso/

PR:		ports/123680
Submitted by:	Ganael Laplanche <ganael.laplanche at martymac.com>
This commit is contained in:
Martin Wilke 2008-05-18 15:44:54 +00:00
parent ef850abeba
commit 57d6225b2b
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=213278
10 changed files with 178 additions and 0 deletions

View File

@ -45,6 +45,7 @@
SUBDIR += hcfmdm
SUBDIR += hcidump
SUBDIR += hf
SUBDIR += hso-kmod
SUBDIR += hylafax
SUBDIR += ib-kmod
SUBDIR += java-commapi

82
comms/hso-kmod/Makefile Normal file
View File

@ -0,0 +1,82 @@
# New ports collection makefile for: hso-kmod
# Date created: 12 May 2008
# Whom: Ganael Laplanche <ganael.laplanche@martymac.com>
#
# $FreeBSD$
#
PORTNAME= hso
PORTVERSION= 20080514
CATEGORIES= comms kld
MASTER_SITES= http://www.shapeshifter.se/pub/hso/
PKGNAMESUFFIX= -kmod
DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX}
MAINTAINER= ganael.laplanche@martymac.com
COMMENT= Driver for Option HSDPA modem
NO_PACKAGE= should be recompiled for a particular FreeBSD kernel
OPTIONS= HSOCTL "Build hsoctl tool" on \
DEVD "Install devd files" on \
DEBUG "Build with debug symbols" on
SUB_FILES= pkg-message
KMODDIR?= /boot/modules
PLIST_SUB+= KMODDIR=${KMODDIR}
MAKE_ENV+= KMODDIR=${KMODDIR}
MAN4= hso.4
.include <bsd.port.pre.mk>
.if !defined(WITHOUT_HSOCTL)
DISTFILES+= hsoctl-${PORTVERSION}${EXTRACT_SUFX}
WRKSRC_HSOCTL= ${WRKDIR}/hsoctl-${PORTVERSION}
PLIST_SUB+= PL_HSOCTL=""
MAN1= hsoctl.1
.else
PLIST_SUB+= PL_HSOCTL="@comment "
.endif
.if !defined(WITHOUT_DEVD)
PLIST_SUB+= PL_DEVD=""
.else
PLIST_SUB+= PL_DEVD="@comment "
.endif
.if defined(WITHOUT_DEBUG)
EXTRA_PATCHES+= ${PATCHDIR}/HSO-DEBUG-patch-Makefile
.endif
.if !exists(/usr/src/sys/Makefile)
IGNORE= requires kernel source files
.elif ${OSVERSION} < 700055
IGNORE= requires FreeBSD 7.0 or superior
.endif
post-patch:
.if !defined(WITHOUT_HSOCTL) && defined(WITHOUT_DEBUG)
@${PATCH} -d ${WRKSRC_HSOCTL} < ${PATCHDIR}/HSOCTL-DEBUG-patch-Makefile
.endif
post-build:
.if !defined(WITHOUT_HSOCTL)
@cd ${WRKSRC_HSOCTL} && ${SETENV} NO_MANCOMPRESS= ${MAKE} all
.endif
post-install:
${INSTALL_MAN} ${MAN4:S|^|${WRKSRC}/|} ${PREFIX}/man/man4
.if !defined(WITHOUT_HSOCTL)
@cd ${WRKSRC_HSOCTL} && \
${SETENV} DESTDIR=${PREFIX}/ BINDIR=bin MANDIR=man/man NO_MANCOMPRESS= \
${MAKE} install
.endif
.if !defined(WITHOUT_DEVD)
${MKDIR} ${PREFIX}/etc/devd
${INSTALL_DATA} ${FILESDIR}/option-icon.conf.sample ${PREFIX}/etc/devd/
@if [ ! -f ${PREFIX}/etc/devd/option-icon.conf ]; then \
${CP} -p ${PREFIX}/etc/devd/option-icon.conf.sample ${PREFIX}/etc/devd/option-icon.conf; \
fi
.endif
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

6
comms/hso-kmod/distinfo Normal file
View File

@ -0,0 +1,6 @@
MD5 (hso-20080514.tar.gz) = 72162021aa4d05304537bf83389f77a6
SHA256 (hso-20080514.tar.gz) = 9c72974973e8f11cdcd42c251adab0780180a9dc5f098ee8968520db02564f9f
SIZE (hso-20080514.tar.gz) = 10345
MD5 (hsoctl-20080514.tar.gz) = 82a7e179222eff55d9633ef23bba9caf
SHA256 (hsoctl-20080514.tar.gz) = 76d5ad970b1ffa426e67ba939f396009f4b6b1d54c555712bf02202904826913
SIZE (hsoctl-20080514.tar.gz) = 6645

View File

@ -0,0 +1,11 @@
--- Makefile.orig 2008-05-14 14:18:19.880920578 +0200
+++ Makefile 2008-05-14 14:18:29.051785451 +0200
@@ -2,7 +2,7 @@
S= ${.CURDIR}/../..
.PATH: $S/dev/usb
-CFLAGS+= -DUSB_DEBUG=1 -DHSO_DEBUG=-1 -g
+#CFLAGS+= -DUSB_DEBUG=1 -DHSO_DEBUG=-1 -g
KMOD= hso
SRCS= if_hso.c opt_usb.h device_if.h bus_if.h usbdevs.h

View File

@ -0,0 +1,9 @@
--- Makefile.orig 2008-05-14 14:18:53.751411172 +0200
+++ Makefile 2008-05-14 14:19:01.497294028 +0200
@@ -1,5 +1,5 @@
SRCS= hsoctl.c
PROG= hsoctl
-CFLAGS+= -g
+#CFLAGS+= -g
.include <bsd.prog.mk>

View File

@ -0,0 +1,7 @@
attach 100 {
match "device-name" "umass[0-9]+";
match "vendor" "0x0af0";
match "product" "0x6911|0x6971|0x7251|0x7401";
match "devclass" "0x00";
action "sleep 1; /sbin/camcontrol cmd `/sbin/camcontrol devlist | /usr/bin/grep ZCOPTION | /usr/bin/awk '{match($11, /pass[0-9]+/); print substr($11, RSTART, RLENGTH) }'` -c '01 00 00 00 00 00' -i 1 i1 > /dev/null";
};

View File

@ -0,0 +1,20 @@
--- if_hso.c.orig 2008-05-18 15:16:15.402471749 +0200
+++ if_hso.c 2008-05-18 15:16:54.689656014 +0200
@@ -831,7 +831,7 @@
ht = tp->t_sc;
if (cnt > ht->ht_obufsz) {
- DPRINTF(1, "too many bytes %d, reducing to %d\n",
+ DPRINTF(1, "too many bytes %d, reducing to %zd\n",
cnt, ht->ht_obufsz);
cnt = ht->ht_obufsz;
}
@@ -1005,7 +1005,7 @@
len = m->m_pkthdr.len - ETHER_HDR_LEN;
m_copydata(m, ETHER_HDR_LEN, len, ib->ib_buf);
- DPRINTF(5, "hso_if_start: mlen=%d, len=%d\n",
+ DPRINTF(5, "hso_if_start: mlen=%d, len=%zd\n",
m->m_pkthdr.len, len);
m_freem(m);

View File

@ -0,0 +1,20 @@
===============================================================================
This port has installed the hso kernel module.
1) To load the kernel module at boot time,
add the following line to /boot/loader.conf:
hso_load="YES"
2) If you have installed devd files, restart devd :
/etc/rc.d/devd restart
3) If you have built the hsoctl utility, use it to connect :
e.g. : hsoctl -a bredband.tre.se -p 1234 hso0
4) Enjoy !
===============================================================================

13
comms/hso-kmod/pkg-descr Normal file
View File

@ -0,0 +1,13 @@
FreeBSD driver for newer Option HSDPA USB dongles.
The driver have been tested with the following devices
* Option GlobeSurfer iCON 7.2 (2.4.6Hd firmware)
* Option GlobeSurfer iCON 225
Older cards should work just fine with ubsa(4) or any similar
USB-over-serial driver.
Note that this driver should be considered beta.
WWW: http://www.shapeshifter.se/code/hso/

9
comms/hso-kmod/pkg-plist Normal file
View File

@ -0,0 +1,9 @@
%%PL_DEVD%%@unexec if cmp -s %D/etc/devd/option-icon.conf.sample %D/etc/devd/option-icon.conf; then rm -f %D/etc/devd/option-icon.conf; fi
%%PL_DEVD%%etc/devd/option-icon.conf.sample
%%PL_DEVD%%@exec if [ ! -f %D/etc/devd/option-icon.conf ]; then mkdir -p %B; cp -p %D/%F %B/option-icon.conf; fi
%%PL_DEVD%%@dirrmtry etc/devd
%%PL_HSOCTL%%bin/hsoctl
@cwd /boot/modules
hso.ko
@exec kldxref %D
@unexec kldxref %D