summaryrefslogtreecommitdiff
path: root/openembedded/packages/orinoco
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2005-09-20 07:04:35 +0000
committerRichard Purdie <richard@openedhand.com>2005-09-20 07:04:35 +0000
commitb4a7122cacef647dbec3db5c9ebe1e504a7670df (patch)
tree006885a1f4e8032062632ee1a091e72c32dd2810 /openembedded/packages/orinoco
parentf9e1d16bfa73a2df5254c63ae1abb6a4bbe0a062 (diff)
downloadopenembedded-core-b4a7122cacef647dbec3db5c9ebe1e504a7670df.tar.gz
openembedded-core-b4a7122cacef647dbec3db5c9ebe1e504a7670df.tar.bz2
openembedded-core-b4a7122cacef647dbec3db5c9ebe1e504a7670df.zip
Updates against mainline OE
git-svn-id: https://svn.o-hand.com/repos/poky@26 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'openembedded/packages/orinoco')
-rw-r--r--openembedded/packages/orinoco/spectrum-fw.bb20
-rwxr-xr-xopenembedded/packages/orinoco/spectrum-fw/get_symbol_fw43
-rwxr-xr-xopenembedded/packages/orinoco/spectrum-fw/parse_symbol_fw129
3 files changed, 192 insertions, 0 deletions
diff --git a/openembedded/packages/orinoco/spectrum-fw.bb b/openembedded/packages/orinoco/spectrum-fw.bb
new file mode 100644
index 0000000000..1d388332a5
--- /dev/null
+++ b/openembedded/packages/orinoco/spectrum-fw.bb
@@ -0,0 +1,20 @@
+DESCRIPTION = "Firmware for Spectrum Wireless LAN cards"
+LICENSE = "unknown"
+PR = "r0"
+
+SRC_URI = "file://get_symbol_fw \
+ file://parse_symbol_fw"
+
+S = "${WORKDIR}"
+
+do_compile() {
+ ./get_symbol_fw
+}
+
+FILES_${PN} += "${base_libdir}/firmware/symbol*"
+
+do_install() {
+ install -d ${D}${base_libdir}/firmware/
+ install -m 0755 ${WORKDIR}/symbol_sp24t_prim_fw ${D}${base_libdir}/firmware/symbol_sp24t_prim_fw
+ install -m 0755 ${WORKDIR}/symbol_sp24t_sec_fw ${D}${base_libdir}/firmware/symbol_sp24t_sec_fw
+}
diff --git a/openembedded/packages/orinoco/spectrum-fw/get_symbol_fw b/openembedded/packages/orinoco/spectrum-fw/get_symbol_fw
new file mode 100755
index 0000000000..e7b0bf2d44
--- /dev/null
+++ b/openembedded/packages/orinoco/spectrum-fw/get_symbol_fw
@@ -0,0 +1,43 @@
+#!/bin/sh
+
+# Get firmware for Symbol Spectrum24 Trilogy.
+# Both the header file and the binary firmware files are produced.
+
+# Copyright (C) 2004 Pavel Roskin <proski@gnu.org>
+
+# This script is Free Software, and it can be copied, distributed and
+# modified as defined in the GNU General Public License. A copy of
+# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
+
+# Usage: get_symbol_fw
+# Output: spectrum_fw.h symbol_sp24t_prim_fw symbol_sp24t_sec_fw
+# Needed tools: curl (or wget), unzip, perl.
+
+set -e
+
+URL_BASE='ftp://symstore.longisland.com/Symstore/services_download/wirless_prod/'
+DL_FILE='MC&DriverOnlyInstallers.zip'
+DL_INT1='S24DRVR392B67-01.exe'
+DL_INT2='Driver Only Installer/NetWLan5.sys'
+DRIVER1=symbol1.drv
+DRIVER2=symbol2.drv
+
+get_file() {
+ curl --remote-name "$1" || \
+ wget --passive-ftp "$1" || \
+ wget "$1" || \
+ ftp "$1" </dev/null || \
+ exit 1
+}
+
+if ! test -f $DL_FILE; then
+ get_file $URL_BASE/$DL_FILE
+fi
+
+unzip -p $DL_FILE "$DL_INT1" >$DRIVER1
+unzip -p $DRIVER1 "$DL_INT2" >$DRIVER2
+
+perl parse_symbol_fw $DRIVER2 spectrum_fw.h symbol_sp24t_prim_fw \
+ symbol_sp24t_sec_fw
+
+rm -f $DRIVER1 $DRIVER2 \ No newline at end of file
diff --git a/openembedded/packages/orinoco/spectrum-fw/parse_symbol_fw b/openembedded/packages/orinoco/spectrum-fw/parse_symbol_fw
new file mode 100755
index 0000000000..7fe0ea57c4
--- /dev/null
+++ b/openembedded/packages/orinoco/spectrum-fw/parse_symbol_fw
@@ -0,0 +1,129 @@
+#!/usr/bin/perl -w
+
+# Extract Symbol firmware and convert is to a header file and two binary
+# files.
+
+# Copyright (C) 2004 Pavel Roskin <proski@gnu.org>
+
+# This script is Free Software, and it can be copied, distributed and
+# modified as defined in the GNU General Public License. A copy of
+# its license can be downloaded from http://www.gnu.org/copyleft/gpl.html
+
+# Usage:
+# parse_symbol_fw infile header binfile1 binfile2
+
+use strict;
+
+# Print message and exit (like "die", but without raising an exception).
+# Newline is added at the end.
+sub error
+{
+ printf STDERR "ERROR: ";
+ printf STDERR @_;
+ printf STDERR "\n";
+ exit 1;
+}
+
+sub readnum_ba ()
+{
+ my $byte_a;
+ read INFILE,$byte_a,1;
+ my $byte_b;
+ read INFILE,$byte_b,1;
+ return (ord($byte_b) << 8) + ord($byte_a);
+}
+
+
+if ($#ARGV != 3) {
+ error ("Usage: parse_symbol_fw infile header binfile1 binfile2");
+}
+
+unless (open (INFILE, "< $ARGV[0]")) {
+ error ("couldn't open $ARGV[0] for reading: $!");
+}
+
+unless (open (OUTFILE, "> $ARGV[1]")) {
+ error ("couldn't open $ARGV[1] for writing: $!");
+}
+
+# Process one array, either for primary or for secondary firmware
+sub process_one_array($$) {
+ my $arrname = shift(@_);
+ my $binfile = shift(@_);
+ my $offset = -1;
+ my $str_offset = 0;
+
+ # Skip to the beginning of firmware
+ $/ = "\x00";
+ while (<INFILE>) {
+ if (m{FILE: }g) {
+ $offset = $str_offset + pos() - 6;
+ last;
+ }
+ $str_offset = tell(INFILE);
+ }
+
+ if ($offset == -1) {
+ error("Cannot find FILE: marker");
+ }
+
+ my @fwdata = split;
+ print $fwdata[1] . "\n";
+ seek(INFILE, $offset, 0);
+
+ my $blknum = $fwdata[3];
+ my $pdrlen = $fwdata[4];
+ my $crclen = $fwdata[5];
+ my $compatlen = $fwdata[6];
+
+ while (!eof(INFILE)) {
+ my $byte;
+ read INFILE, $byte, 1;
+ last if (ord($byte) == 0x1a);
+ }
+
+ # Walk all blocks
+ my $block = $blknum;
+ while ($block-- > 0) {
+ seek(INFILE, 4, 1);
+ my $len = readnum_ba();
+ seek(INFILE, $len, 1);
+ }
+
+ my $img_len = tell(INFILE) - $offset + $pdrlen + $crclen + $compatlen + 2;
+ seek(INFILE, $offset, 0);
+
+ # Write binary file for the section
+ unless (open (BINFILE, "> $binfile")) {
+ error ("couldn't open $binfile for writing: $!");
+ }
+
+ # Output the array
+ printf OUTFILE "/* %s %s */\n", $fwdata[1], $fwdata[2];
+ printf OUTFILE "static u8 %s[] = {\n", $arrname;
+
+ my $count = 0;
+ while ($count++ < $img_len) {
+ my $byte;
+ read INFILE, $byte, 1;
+ $byte = ord($byte);
+ printf OUTFILE "0x%02x,", $byte;
+ printf BINFILE "%c", $byte;
+ if ($count % 16 == 0) {
+ printf OUTFILE "\n";
+ }
+ }
+
+ if ($img_len % 16) {
+ printf OUTFILE "\n";
+ }
+
+ print OUTFILE "};\n";
+ close(BINFILE);
+}
+
+process_one_array("primsym", $ARGV[2]);
+process_one_array("secsym", $ARGV[3]);
+
+close(INFILE);
+close(OUTFILE);