1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-11 07:22:22 +00:00

This port was only for the 5.x series (marked IGNORE for < 5.3).

The driver was imported into the src tree and was part of the 5.4
release, therefore the port is no longer needed.

PR:		85934
Submitted by:	Craig Boston <craig@yekse.gank.org>
This commit is contained in:
Yen-Ming Lee 2005-09-10 04:38:49 +00:00
parent 5c679e22e1
commit a02b07da8f
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=142334
9 changed files with 2 additions and 201 deletions

3
MOVED
View File

@ -1602,7 +1602,7 @@ shells/zsh-devel|shells/zsh|2005-08-29|Development version of Zsh is no longer b
russian/nagios||2005-08-30|Obsoleted; new version is not planned
security/gnutls-devel|security/gnutls|2005-08-30|Development version of GnuTLS is no longer being released
www/py-websvcs|net/py-soappy|2005-08-30|duplicate port
x11-toolkits/wxgtk26-contrib-utils|2005-08-31|Deprecated
x11-toolkits/wxgtk26-contrib-utils||2005-08-31|Deprecated
deskutils/gdesklets-psi_displaypackage||2005-08-31|removed; broken with recent gdesklets
deskutils/gdesklets-sensor-psi_externalinterval||2005-08-31|removed; broken with recent gdesklets
deskutils/gdesklets-sensor-psi_memo||2005-08-31|removed; broken with recent gdesklets
@ -1615,3 +1615,4 @@ mail/gdesklets-sensor-psi_popmail||2005-08-31|removed; broken with recent gdeskl
deskutils/gdesklets-sensor-psi_variableborder||2005-08-31|removed; broken with recent gdesklets
mail/py-mimelib|mail/py-email|2005-09-04|renamed
cad/fig2sxd|graphics/fig2sxd|2005-09-08|accurate category
comms/cdce||2005-09-10|Obsolete; imported into the src tree in 5.4 release

View File

@ -1,40 +0,0 @@
# New ports collection makefile for: cdce
# Date Created: Jan 25, 2005
# Whom: Craig Boston <craig@yekse.gank.org>
#
# $FreeBSD$
#
PORTNAME= cdce
PORTVERSION= 1.0
PORTREVISION= 1
CATEGORIES= comms
MASTER_SITES= http://www.gank.org/freebsd/cdce/
MAINTAINER= craig@yekse.gank.org
COMMENT= Driver for point-to-point CDC Ethernet interfaces
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 503000
IGNORE= "FreeBSD versions prior to 5.3 are not supported"
.endif
NO_PACKAGE= Depends on kernel
pre-fetch:
.if !exists(${SRC_BASE}/sys/Makefile)
@${ECHO} "*************************************************"; \
${ECHO} "This port requires the kernel source be available"; \
${ECHO} "*************************************************"; \
exit 1
.endif
do-install:
${MKDIR} ${PREFIX}/lib/cdce
${INSTALL_SCRIPT} ${WRKSRC}/if_cdce.ko ${PREFIX}/lib/cdce
post-install:
@PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>

View File

@ -1,2 +0,0 @@
MD5 (cdce-1.0.tar.gz) = 15d57b1d0d10256e7b88f6f7e237213b
SIZE (cdce-1.0.tar.gz) = 6540

View File

@ -1,94 +0,0 @@
$FreeBSD$
--- if_cdce.c
+++ if_cdce.c
@@ -158,11 +158,12 @@
usb_interface_descriptor_t *id;
usb_endpoint_descriptor_t *ed;
usb_cdc_union_descriptor_t *ud;
+ usb_config_descriptor_t *cd;
struct ifnet *ifp;
int data_ifcno;
u_int16_t macaddr_hi;
char devinfo[1024];
- int i;
+ int i, j, numalts;
bzero(sc, sizeof(struct cdce_softc));
sc->cdce_udev = uaa->device;
@@ -206,29 +207,52 @@
USB_ATTACH_ERROR_RETURN;
}
- /* Find endpoints. */
+ /*
+ * In the case of my CDCEthernet modem, there are several alternate
+ * interface possibilities -- the default first one does not work
+ * (though in the original code it probably worked for those devices
+ * which were supported), and in my case, the next alternate setting
+ * gives me the desired interface. There's another one that also
+ * does not work, so we loop through the possibilities and take the
+ * first one that works.
+ */
id = usbd_get_interface_descriptor(sc->cdce_data_iface);
- sc->cdce_bulkin_no = sc->cdce_bulkout_no = -1;
- for (i = 0; i < id->bNumEndpoints; i++) {
- ed = usbd_interface2endpoint_descriptor(sc->cdce_data_iface, i);
- if (!ed) {
- printf("%s: could not read endpoint descriptor\n",
- sc->cdce_name);
- USB_ATTACH_ERROR_RETURN;
- }
- if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
- UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
- sc->cdce_bulkin_no = ed->bEndpointAddress;
- } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT &&
- UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
- sc->cdce_bulkout_no = ed->bEndpointAddress;
- } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
- UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT) {
- /* XXX: CDC spec defines an interrupt pipe, but it is not
- * needed for simple host-to-host applications. */
- } else {
- printf("%s: unexpected endpoint\n", sc->cdce_name);
- }
+ cd = usbd_get_config_descriptor(sc->cdce_udev);
+ numalts = usbd_get_no_alts(cd, id->bInterfaceNumber);
+
+ for (j = 0; j < numalts; j++) {
+ if (usbd_set_interface(sc->cdce_data_iface, j)) {
+ printf("%s: setting alternate interface failed\n",
+ sc->cdce_name);
+ USB_ATTACH_ERROR_RETURN;
+ }
+ /* Find endpoints. */
+ id = usbd_get_interface_descriptor(sc->cdce_data_iface);
+ sc->cdce_bulkin_no = sc->cdce_bulkout_no = -1;
+ for (i = 0; i < id->bNumEndpoints; i++) {
+ ed = usbd_interface2endpoint_descriptor(sc->cdce_data_iface, i);
+ if (!ed) {
+ printf("%s: could not read endpoint descriptor\n",
+ sc->cdce_name);
+ USB_ATTACH_ERROR_RETURN;
+ }
+ if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
+ UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
+ sc->cdce_bulkin_no = ed->bEndpointAddress;
+ } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_OUT &&
+ UE_GET_XFERTYPE(ed->bmAttributes) == UE_BULK) {
+ sc->cdce_bulkout_no = ed->bEndpointAddress;
+ } else if (UE_GET_DIR(ed->bEndpointAddress) == UE_DIR_IN &&
+ UE_GET_XFERTYPE(ed->bmAttributes) == UE_INTERRUPT) {
+ /* XXX: CDC spec defines an interrupt pipe, but it is not
+ * needed for simple host-to-host applications. */
+ } else {
+ printf("%s: unexpected endpoint\n", sc->cdce_name);
+ }
+ }
+ /* If we found something, try and use it... */
+ if ((sc->cdce_bulkin_no != -1) && (sc->cdce_bulkout_no != -1))
+ break;
}
if (sc->cdce_bulkin_no == -1) {

View File

@ -1,23 +0,0 @@
#!/bin/sh
#
# Unload cdce kernel module if necessary
#
# $FreeBSD$
#
if [ "x$2" != "xDEINSTALL" ]; then
exit 0
fi
echo "Disabling if_cdce."
# Unload if_cdce kernel module
kldstat -n if_cdce 2>/dev/null >/dev/null && kldunload if_cdce
# Remove kernel module
if [ `sysctl -n kern.osreldate` -ge 500000 ]; then
KMODDIR="/boot/modules"
else
KMODDIR="/modules"
fi
[ -f ${KMODDIR}/if_cdce.ko ] && rm -f ${KMODDIR}/if_cdce.ko

View File

@ -1,10 +0,0 @@
This port builds a driver for several devices which communicate using Ethernet
over USB (CDC Ethernet specification). It does not yet include support for
more advanced devices such as cable modems, but is sufficient to talk to
several Linux-based PDAs.
This driver has been confirmed to work with Sharp Zaurus and YOPY handhelds.
It currently only works on FreeBSD 5.3 or later.
WWW: http://www.gank.org/freebsd/cdce/

View File

@ -1,18 +0,0 @@
#!/bin/sh
#
# $FreeBSD$
PREFIX=${PKG_PREFIX:-/usr/local}
[ "x$1" = "x" ] && exit 1
if [ "x$2" = "xPOST-INSTALL" ]; then
if [ `sysctl -n kern.osreldate` -ge 500000 ]; then
KMODDIR="/boot/modules"
else
KMODDIR="/modules"
fi
install -C -o root -g wheel -m 555 ${PREFIX}/lib/cdce/if_cdce.ko \
${KMODDIR}
kldxref ${KMODDIR}
fi

View File

@ -1,11 +0,0 @@
*******************************************************************************
* Please add the line *
* *
* if_cdce_load="YES" *
* *
* to /boot/loader.conf if you wish the driver to be loaded at system startup. *
*******************************************************************************
* This port contains a prebuilt kernel module. Due to the ever changing *
* nature of FreeBSD it may be necessary to rebuild the module after a kernel *
* source update. To do this, reinstall the port. *
*******************************************************************************

View File

@ -1,2 +0,0 @@
lib/cdce/if_cdce.ko
@dirrm lib/cdce