Commit df62f0fd authored by Colin Watson's avatar Colin Watson

import pcmciautils 001

parents
This diff is collapsed.
# Makefile for pcmciautils
#
# Copyright (C) 2005 Dominik Brodowski <linux@dominikbrodowski.net>
#
# Based largely on the Makefile for udev by:
#
# Copyright (C) 2003,2004 Greg Kroah-Hartman <greg@kroah.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# Set the following to `true' to log the debug
# and make a unstripped, unoptimized binary.
# Leave this set to `false' for production use.
DEBUG = false
PCCARDCTL = pccardctl
PCMCIA_CHECK_BROKEN_CIS = pcmcia-check-broken-cis
PCMCIA_MODALIAS = pcmcia-modalias
PCMCIA_SOCKET_STARTUP = pcmcia-socket-startup
VERSION = 001
#INSTALL_DIR = /usr/local/sbin
RELEASE_NAME = pcmciautils-$(VERSION)
#DESTDIR =
KERNEL_DIR = /lib/modules/${shell uname -r}/build
# override this to make udev look in a different location for it's config files
prefix =
exec_prefix = ${prefix}
etcdir = ${prefix}/etc
sbindir = ${exec_prefix}/sbin
srcdir = .
INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = ${INSTALL}
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
# place to put our hotplug scripts nodes
hotplugdir = ${prefix}/etc/hotplug
# place where PCMICIA config is put to
pcmciaconfdir = ${prefix}${etcdir}/pcmcia
# make the build silent. Set this to something else to make it noisy again.
V=false
# set up PWD so that older versions of make will work with our build.
PWD = $(shell pwd)
# If you are running a cross compiler, you may want to set this
# to something more interesting, like "arm-linux-". If you want
# to compile vs uClibc, that can be done here as well.
CROSS = #/usr/i386-linux-uclibc/usr/bin/i386-uclibc-
CC = $(CROSS)gcc
LD = $(CROSS)gcc
AR = $(CROSS)ar
STRIP = $(CROSS)strip
RANLIB = $(CROSS)ranlib
HOSTCC = gcc
export CROSS CC AR STRIP RANLIB CFLAGS LDFLAGS LIB_OBJS ARCH_LIB_OBJS CRT0
# code taken from uClibc to determine the current arch
ARCH := ${shell $(CC) -dumpmachine | sed -e s'/-.*//' -e 's/i.86/i386/' -e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' -e 's/m68k.*/m68k/' -e 's/powerpc/ppc/g'}
# code taken from uClibc to determine the gcc include dir
GCCINCDIR := ${shell LC_ALL=C $(CC) -print-search-dirs | sed -ne "s/install: \(.*\)/\1include/gp"}
# code taken from uClibc to determine the libgcc.a filename
GCC_LIB := $(shell $(CC) -print-libgcc-file-name )
# use '-Os' optimization if available, else use -O2
OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>&1; \
then echo "-Os"; else echo "-O2" ; fi}
# check if compiler option is supported
cc-supports = ${shell if $(CC) ${1} -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; fi;}
WARNINGS := -Wall -fno-builtin -Wchar-subscripts -Wpointer-arith -Wsign-compare
WARNINGS += $(call cc-supports,-Wno-pointer-sign)
WARNINGS += $(call cc-supports,-Wdeclaration-after-statement)
WARNINGS += -Wshadow
CFLAGS := -pipe
HEADERS = \
src/cistpl.h \
src/startup.h \
src/yacc_config.h
OBJS = \
src/lex_config.l \
src/pccardctl.c \
src/pcmcia-check-broken-cis.c \
src/pcmcia-modalias.c \
src/read-cis.c \
src/startup.c \
src/startup.h \
src/yacc_config.h \
src/yacc_config.y
CFLAGS += -I$(PWD)/src
#LIBC =
CFLAGS += $(WARNINGS) -I$(GCCINCDIR)
LIB_OBJS = -lc -lsysfs
#LDFLAGS =
ifeq ($(strip $(V)),false)
QUIET=@$(PWD)/build/ccdv
HOST_PROGS=build/ccdv
else
QUIET=
HOST_PROGS=
endif
# if DEBUG is enabled, then we do not strip or optimize
ifeq ($(strip $(DEBUG)),true)
CFLAGS += -O1 -g -DDEBUG -D_GNU_SOURCE
LDFLAGS += -Wl,-warn-common
STRIPCMD = /bin/true -Since_we_are_debugging
else
CFLAGS += $(OPTIMIZATION) -fomit-frame-pointer -D_GNU_SOURCE
LDFLAGS += -s -Wl,-warn-common
STRIPCMD = $(STRIP) -s --remove-section=.note --remove-section=.comment
endif
all: ccdv $(PCCARDCTL) $(PCMCIA_CHECK_BROKEN_CIS) $(PCMCIA_MODALIAS) $(PCMCIA_SOCKET_STARTUP)
ccdv:
@echo "Building ccdv"
@$(HOSTCC) -O1 build/ccdv.c -o build/ccdv
.c.o:
$(QUIET) $(CC) $(CFLAGS) -c -o $@ $<
$(PCCARDCTL): $(LIBC) src/$(PCCARDCTL).o $(OBJS) $(HEADERS)
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCCARDCTL).o $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(QUIET) $(STRIPCMD) $@
$(PCMCIA_CHECK_BROKEN_CIS): $(LIBC) src/$(PCMCIA_CHECK_BROKEN_CIS).o src/read-cis.o $(OBJS) $(HEADERS)
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCMCIA_CHECK_BROKEN_CIS).o src/read-cis.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(QUIET) $(STRIPCMD) $@
$(PCMCIA_MODALIAS): $(LIBC) src/$(PCMCIA_MODALIAS).o $(OBJS) $(HEADERS)
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/$(PCMCIA_MODALIAS).o $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(QUIET) $(STRIPCMD) $@
$(PCMCIA_SOCKET_STARTUP): $(LIBC) src/startup.o src/yacc_config.o src/lex_config.o $(OBJS) $(HEADERS)
$(QUIET) $(LD) $(LDFLAGS) -o $@ $(CRT0) src/startup.o src/yacc_config.o src/lex_config.o $(LIB_OBJS) $(ARCH_LIB_OBJS)
$(QUIET) $(STRIPCMD) $@
yacc_config.o lex_config.o: %.o: %.c
$(CC) -c -MD -O -pipe $(CPPFLAGS) $<
clean:
-find . \( -not -type d \) -and \( -name '*~' -o -name '*.[oas]' \) -type f -print \
| xargs rm -f
-rm -f $(PCCARDCTL) $(PCMCIA_CHECK_BROKEN_CIS) $(PCMCIA_MODALIAS) $(PCMCIA_SOCKET_STARTUP)
-rm -f src/yacc_config.c src/yacc_config.d src/lex_config.c src/lex_config.d
-rm -f build/ccdv
install-hotplug:
$(INSTALL) -d $(DESTDIR)$(hotplugdir)
$(INSTALL_PROGRAM) -D hotplug/pcmcia.agent $(DESTDIR)$(hotplugdir)/pcmcia.agent
$(INSTALL_PROGRAM) -D hotplug/pcmcia.rc $(DESTDIR)$(hotplugdir)/pcmcia.rc
$(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.agent $(DESTDIR)$(hotplugdir)/pcmcia_socket.agent
$(INSTALL_PROGRAM) -D hotplug/pcmcia_socket.rc $(DESTDIR)$(hotplugdir)/pcmcia_socket.rc
uninstall-hotplug:
- rm -f $(hotplugdir)/pcmcia.agent $(hotplugdir)/pcmcia.rc
- rm -f $(hotplugdir)/pcmcia_socket.agent $(hotplugdir)/pcmcia_socket.rc
install-tools:
$(INSTALL) -d $(DESTDIR)$(sbindir)
$(INSTALL_PROGRAM) -D $(PCMCIA_MODALIAS) $(DESTDIR)$(sbindir)/$(PCMCIA_MODALIAS)
$(INSTALL_PROGRAM) -D $(PCMCIA_SOCKET_STARTUP) $(DESTDIR)$(sbindir)/$(PCMCIA_SOCKET_STARTUP)
$(INSTALL_PROGRAM) -D $(PCCARDCTL) $(DESTDIR)$(sbindir)/$(PCCARDCTL)
$(INSTALL_PROGRAM) -D $(PCMCIA_CHECK_BROKEN_CIS) $(DESTDIR)$(sbindir)/$(PCMCIA_CHECK_BROKEN_CIS)
uninstall-tools:
- rm -f $(sbindir)/$(PCMCIA_MODALIAS)
- rm -f $(sbindir)/$(PCMCIA_SOCKET_STARTUP)
- rm -f $(sbindir)/$(PCCARDCTL)
- rm -f $(sbindir)/$(PCMCIA_CHECK_BROKEN_CIS)
install-config:
$(INSTALL) -d $(DESTDIR)$(pcmciaconfdir)
$(INSTALL_DATA) -D config/config.opts $(DESTDIR)$(pcmciaconfdir)/config.opts
uninstall-config:
# - rm -f $(pcmciaconfdir)/config.opts
install: install-tools install-hotplug install-config
uninstall: uninstall-tools uninstall-hotplug uninstall-config
/* ccdv.c
*
* Copyright (C) 2002-2003, by Mike Gleason, NcFTP Software.
* All Rights Reserved.
*
* Licensed under the GNU Public License.
*/
#include <unistd.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <fcntl.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#define SETCOLOR_SUCCESS (gANSIEscapes ? "\033\1331;32m" : "")
#define SETCOLOR_FAILURE (gANSIEscapes ? "\033\1331;31m" : "")
#define SETCOLOR_WARNING (gANSIEscapes ? "\033\1331;33m" : "")
#define SETCOLOR_NORMAL (gANSIEscapes ? "\033\1330;39m" : "")
#define TEXT_BLOCK_SIZE 8192
#define INDENT 2
#define TERMS "vt100:vt102:vt220:vt320:xterm:xterm-color:ansi:linux:scoterm:scoansi:dtterm:cons25:cygwin"
size_t gNBufUsed = 0, gNBufAllocated = 0;
char *gBuf = NULL;
int gCCPID;
char gAction[200] = "";
char gTarget[200] = "";
char gAr[32] = "";
char gArLibraryTarget[64] = "";
int gDumpCmdArgs = 0;
char gArgsStr[1000];
int gColumns = 80;
int gANSIEscapes = 0;
int gExitStatus = 95;
static void DumpFormattedOutput(void)
{
char *cp;
char spaces[8 + 1] = " ";
char *saved;
int curcol;
int i;
curcol = 0;
saved = NULL;
for (cp = gBuf + ((gDumpCmdArgs == 0) ? strlen(gArgsStr) : 0); ; cp++) {
if (*cp == '\0') {
if (saved != NULL) {
cp = saved;
saved = NULL;
} else break;
}
if (*cp == '\r')
continue;
if (*cp == '\t') {
saved = cp + 1;
cp = spaces + 8 - (8 - ((curcol - INDENT - 1) % 8));
}
if (curcol == 0) {
for (i = INDENT; --i >= 0; )
putchar(' ');
curcol = INDENT;
}
putchar(*cp);
if (++curcol == (gColumns - 1)) {
putchar('\n');
curcol = 0;
} else if (*cp == '\n')
curcol = 0;
}
free(gBuf);
} /* DumpFormattedOutput */
/* Difftime(), only for timeval structures. */
static void TimeValSubtract(struct timeval *tdiff, struct timeval *t1, struct timeval *t0)
{
tdiff->tv_sec = t1->tv_sec - t0->tv_sec;
tdiff->tv_usec = t1->tv_usec - t0->tv_usec;
if (tdiff->tv_usec < 0) {
tdiff->tv_sec--;
tdiff->tv_usec += 1000000;
}
} /* TimeValSubtract */
static void Wait(void)
{
int pid2, status;
do {
status = 0;
pid2 = (int) waitpid(gCCPID, &status, 0);
} while (((pid2 >= 0) && (! WIFEXITED(status))) || ((pid2 < 0) && (errno == EINTR)));
if (WIFEXITED(status))
gExitStatus = WEXITSTATUS(status);
} /* Wait */
static int SlurpProgress(int fd)
{
char s1[71];
char *newbuf;
int nready;
size_t ntoread;
ssize_t nread;
struct timeval now, tnext, tleft;
fd_set ss;
fd_set ss2;
const char *trail = "/-\\|", *trailcp;
trailcp = trail;
snprintf(s1, sizeof(s1), "%s%s%s... ", gAction, gTarget[0] ? " " : "", gTarget);
printf("\r%-70s%-9s", s1, "");
fflush(stdout);
gettimeofday(&now, NULL);
tnext = now;
tnext.tv_sec++;
tleft.tv_sec = 1;
tleft.tv_usec = 0;
FD_ZERO(&ss2);
FD_SET(fd, &ss2);
for(;;) {
if (gNBufUsed == (gNBufAllocated - 1)) {
if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) {
perror("ccdv: realloc");
return (-1);
}
gNBufAllocated += TEXT_BLOCK_SIZE;
gBuf = newbuf;
}
for (;;) {
ss = ss2;
nready = select(fd + 1, &ss, NULL, NULL, &tleft);
if (nready == 1)
break;
if (nready < 0) {
if (errno != EINTR) {
perror("ccdv: select");
return (-1);
}
continue;
}
gettimeofday(&now, NULL);
if ((now.tv_sec > tnext.tv_sec) || ((now.tv_sec == tnext.tv_sec) && (now.tv_usec >= tnext.tv_usec))) {
tnext = now;
tnext.tv_sec++;
tleft.tv_sec = 1;
tleft.tv_usec = 0;
printf("\r%-71s%c%-7s", s1, *trailcp, "");
fflush(stdout);
if (*++trailcp == '\0')
trailcp = trail;
} else {
TimeValSubtract(&tleft, &tnext, &now);
}
}
ntoread = (gNBufAllocated - gNBufUsed - 1);
nread = read(fd, gBuf + gNBufUsed, ntoread);
if (nread < 0) {
if (errno == EINTR)
continue;
perror("ccdv: read");
return (-1);
} else if (nread == 0) {
break;
}
gNBufUsed += nread;
gBuf[gNBufUsed] = '\0';
}
snprintf(s1, sizeof(s1), "%s%s%s: ", gAction, gTarget[0] ? " " : "", gTarget);
Wait();
if (gExitStatus == 0) {
printf("\r%-70s", s1);
printf("[%s%s%s]", ((gNBufUsed - strlen(gArgsStr)) < 4) ? SETCOLOR_SUCCESS : SETCOLOR_WARNING, "OK", SETCOLOR_NORMAL);
printf("%-5s\n", " ");
} else {
printf("\r%-70s", s1);
printf("[%s%s%s]", SETCOLOR_FAILURE, "ERROR", SETCOLOR_NORMAL);
printf("%-2s\n", " ");
gDumpCmdArgs = 1; /* print cmd when there are errors */
}
fflush(stdout);
return (0);
} /* SlurpProgress */
static int SlurpAll(int fd)
{
char *newbuf;
size_t ntoread;
ssize_t nread;
printf("%s%s%s.\n", gAction, gTarget[0] ? " " : "", gTarget);
fflush(stdout);
for(;;) {
if (gNBufUsed == (gNBufAllocated - 1)) {
if ((newbuf = (char *) realloc(gBuf, gNBufAllocated + TEXT_BLOCK_SIZE)) == NULL) {
perror("ccdv: realloc");
return (-1);
}
gNBufAllocated += TEXT_BLOCK_SIZE;
gBuf = newbuf;
}
ntoread = (gNBufAllocated - gNBufUsed - 1);
nread = read(fd, gBuf + gNBufUsed, ntoread);
if (nread < 0) {
if (errno == EINTR)
continue;
perror("ccdv: read");
return (-1);
} else if (nread == 0) {
break;
}
gNBufUsed += nread;
gBuf[gNBufUsed] = '\0';
}
Wait();
gDumpCmdArgs = (gExitStatus != 0); /* print cmd when there are errors */
return (0);
} /* SlurpAll */
static const char *Basename(const char *path)
{
const char *cp;
cp = strrchr(path, '/');
if (cp == NULL)
return (path);
return (cp + 1);
} /* Basename */
static const char * Extension(const char *path)
{
const char *cp = path;
cp = strrchr(path, '.');
if (cp == NULL)
return ("");
// printf("Extension='%s'\n", cp);
return (cp);
} /* Extension */
static void Usage(void)
{
fprintf(stderr, "Usage: ccdv /path/to/cc CFLAGS...\n\n");
fprintf(stderr, "I wrote this to reduce the deluge Make output to make finding actual problems\n");
fprintf(stderr, "easier. It is intended to be invoked from Makefiles, like this. Instead of:\n\n");
fprintf(stderr, "\t.c.o:\n");
fprintf(stderr, "\t\t$(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n");
fprintf(stderr, "\nRewrite your rule so it looks like:\n\n");
fprintf(stderr, "\t.c.o:\n");
fprintf(stderr, "\t\t@ccdv $(CC) $(CFLAGS) $(DEFS) $(CPPFLAGS) $< -c\n\n");
fprintf(stderr, "ccdv 1.1.0 is Free under the GNU Public License. Enjoy!\n");
fprintf(stderr, " -- Mike Gleason, NcFTP Software <http://www.ncftp.com>\n");
exit(96);
} /* Usage */
int main(int argc, char **argv)
{
int pipe1[2];
int devnull;
char emerg[256];
int fd;
int nread;
int i;
int cc = 0, pch = 0;
const char *quote;
if (argc < 2)
Usage();
snprintf(gAction, sizeof(gAction), "Running %s", Basename(argv[1]));
memset(gArgsStr, 0, sizeof(gArgsStr));
for (i = 1; i < argc; i++) {
// printf("argv[%d]='%s'\n", i, argv[i]);
quote = (strchr(argv[i], ' ') != NULL) ? "\"" : "";
snprintf(gArgsStr + strlen(gArgsStr), sizeof(gArgsStr) - strlen(gArgsStr), "%s%s%s%s%s", (i == 1) ? "" : " ", quote, argv[i], quote, (i == (argc - 1)) ? "\n" : "");
if ((strcmp(argv[i], "-o") == 0) && ((i + 1) < argc)) {
if (strcasecmp(Extension(argv[i + 1]), ".o") != 0) {
strcpy(gAction, "Linking");
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i + 1]));
}
} else if (strchr("-+", (int) argv[i][0]) != NULL) {
continue;
} else if (strncasecmp(Extension(argv[i]), ".c", 2) == 0) {
cc++;
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));
// printf("gTarget='%s'\n", gTarget);
} else if ((strncasecmp(Extension(argv[i]), ".h", 2) == 0) && (cc == 0)) {
pch++;
snprintf(gTarget, sizeof(gTarget), "%s", Basename(argv[i]));
} else if ((i == 1) && (strcmp(Basename(argv[i]), "ar") == 0)) {
snprintf(gAr, sizeof(gAr), "%s", Basename(argv[i]));
} else if ((gArLibraryTarget[0] == '\0') && (strcasecmp(Extension(argv[i]), ".a") == 0)) {
snprintf(gArLibraryTarget, sizeof(gArLibraryTarget), "%s", Basename(argv[i]));
}
}
if ((gAr[0] != '\0') && (gArLibraryTarget[0] != '\0')) {
strcpy(gAction, "Creating library");
snprintf(gTarget, sizeof(gTarget), "%s", gArLibraryTarget);
} else if (pch > 0) {
strcpy(gAction, "Precompiling");
} else if (cc > 0) {
strcpy(gAction, "Compiling");
}
if (pipe(pipe1) < 0) {
perror("ccdv: pipe");
exit(97);
}
(void) close(0);
devnull = open("/dev/null", O_RDWR, 00666);
if ((devnull != 0) && (dup2(devnull, 0) == 0))
close(devnull);
gCCPID = (int) fork();
if (gCCPID < 0) {
(void) close(pipe1[0]);
(void) close(pipe1[1]);
perror("ccdv: fork");
exit(98);
} else if (gCCPID == 0) {
/* Child */
(void) close(pipe1[0]); /* close read end */
if (pipe1[1] != 1) { /* use write end on stdout */
(void) dup2(pipe1[1], 1);
(void) close(pipe1[1]);
}
(void) dup2(1, 2); /* use write end on stderr */
execvp(argv[1], argv + 1);
perror(argv[1]);
exit(99);
}
/* parent */
(void) close(pipe1[1]); /* close write end */
fd = pipe1[0]; /* use read end */
gColumns = (getenv("COLUMNS") != NULL) ? atoi(getenv("COLUMNS")) : 80;
gANSIEscapes = (getenv("TERM") != NULL) && (strstr(TERMS, getenv("TERM")) != NULL);
gBuf = (char *) malloc(TEXT_BLOCK_SIZE);
if (gBuf == NULL)
goto panic;
gNBufUsed = 0;
gNBufAllocated = TEXT_BLOCK_SIZE;
if (strlen(gArgsStr) < (gNBufAllocated - 1)) {
strcpy(gBuf, gArgsStr);
gNBufUsed = strlen(gArgsStr);
}
if (isatty(1)) {
if (SlurpProgress(fd) < 0)
goto panic;
} else {
if (SlurpAll(fd) < 0)
goto panic;
}
DumpFormattedOutput();
exit(gExitStatus);
panic:
gDumpCmdArgs = 1; /* print cmd when there are errors */
DumpFormattedOutput();
while ((nread = read(fd, emerg, (size_t) sizeof(emerg))) > 0)
(void) write(2, emerg, (size_t) nread);
Wait();
exit(gExitStatus);
} /* main */
#
# Local PCMCIA Configuration File
#
#----------------------------------------------------------------------
#
# System resources available for PCMCIA cards
#
# NOTE: these settings have no effect on resources assigned to a
# CardBus bridge device itself; this file only affects resources
# assigned to cards. Also, interrupt settings here will only affect
# ISA bus interrupts assigned to 16-bit cards. PCI interrupts
# generally can't be reconfigured.
#
# With the kernel PCMCIA subsystem, these settings also have no effect
# at all on resources used for 32-bit CardBus cards. Those are set by
# the PCI hotplug subsystem.
#
include port 0x100-0x4ff, port 0x800-0x8ff, port 0xc00-0xcff
include memory 0xc0000-0xfffff
include memory 0xa0000000-0xa0ffffff, memory 0x60000000-0x60ffffff
# High port numbers do not always work...
# include port 0x1000-0x17ff
# Extra port range for IBM Token Ring
include port 0xa00-0xaff
# Resources we should not use, even if they appear to be available
# First built-in serial port
exclude irq 4
# Second built-in serial port
#exclude irq 3
# First built-in parallel port
exclude irq 7
#----------------------------------------------------------------------
# Examples of options for loadable modules
# To fix sluggish network with IBM ethernet adapter...
#module "pcnet_cs" opts "mem_speed=600"
# Options for IBM Token Ring adapters
#module "ibmtr_cs" opts "mmiobase=0xd0000 srambase=0xd4000"
# Options for Raylink/WebGear driver: uncomment only one line...
# Generic ad-hoc network
module "ray_cs" opts "essid=ADHOC_ESSID hop_dwell=128 beacon_period=256 translate=1"
# Infrastructure network for older cards
#module "ray_cs" opts "net_type=1 essid=ESSID1"
# Infrastructure network for WebGear
#module "ray_cs" opts "net_type=1 essid=ESSID1 translate=1 hop_dwell=128 beacon_period=256"
# Options for WaveLAN/IEEE driver (AccessPoint mode)...
#module "wvlan_cs" opts "station_name=MY_PC"
# Options for WaveLAN/IEEE driver (ad-hoc mode)...
#module "wvlan_cs" opts "port_type=3 channel=1 station_name=MY_PC"
# Options for Xircom Netwave driver...
#module "netwave_cs" opts "domain=0x100 scramble_key=0x0"
#!/bin/sh
#
# PCMCIA-specific hotplug policy agent
#
# $Id$
#
#DEBUG=yes; export DEBUG
SYSFS=/sys
cd /etc/hotplug
. ./hotplug.functions
if [ "$ACTION" = "" ]; then
mesg Bad PCMCIA agent invocation, no action
exit 1
fi
debug_mesg $SOCKET_NO $DEVICE_NO $MODNAME $DEVPATH
case $ACTION in
add)
modprobe $MODNAME
# check whether the CIS is completely broken
if [ ! -h $SYSFS$DEVPATH/driver ]; then
CISFILE=$(pcmcia-check-broken-cis $SOCKET_NO)
debug_mesg $CISFILE;
if [ ! -z $CISFILE ]; then
if [ -f /etc/pcmcia/cis/$CISFILE ]; then
cat /etc/pcmcia/cis/$CISFILE > /sys/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis
elif [ -f /lib/firmware/cis/$CISFILE ]; then
cat /lib/firmware/cis/$CISFILE > /sys/class/pcmcia_socket/pcmcia_socket$(SOCKET_NO)/cis
fi;
fi;
fi;
# allow a match solely based on the "function ID" field
if [ ! -h $SYSFS$DEVPATH/driver ]; then
if [ -w $SYSFS$DEVPATH/allow_func_id_match ]; then
debug_mesg allowing func_id based match for PCMCIA device $SOCKET_NO.$DEVICE_NO
echo -n "42" > $SYSFS$DEVPATH/allow_func_id_match;
fi;
fi;
;;
remove)
;;
*)
debug_mesg "PCMCIA '$ACTION' event not supported"
;;
esac
#!/bin/sh
# vim: syntax=sh
#
# pcmcia.rc recover lost boot-time pcmcia_socket hotplug events
#
# $Id: $
#
PATH=/sbin:/bin:/usr/sbin:/usr/bin
#DEBUG=yes; export DEBUG
cd /etc/hotplug
. ./hotplug.functions
pcmcia_boot_events ()
{
if [ -d /sys/bus/pcmcia/devices/ ]; then
# 2.6 kernels