FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian Kernel

 
 
LinkBack Thread Tools
 
Old 06-05-2008, 10:35 PM
dann frazier
 
Default firmware-nonfree update for etchnhalf

I'd like to propose the following update for stable.

I've tested on an etch laptop w/ built-in intel 3945 wireless and a
server w/ a bnx2 nic under both etch and etchnhalf.

Index: debian/changelog
================================================== =================
--- debian/changelog (.../releases/firmware-nonfree/0.4etch1) (revision 11527)
+++ debian/changelog (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -1,3 +1,13 @@
+firmware-nonfree (0.4+etchnhalf.1) UNRELEASED; urgency=low
+
+ * Backport iwlwifi and bnx2 firmware from 0.11 release, only used
+ in etch by drivers in the etchnhalf kernel.
+ * Add initramfs hook support for bnx2
+ * Correct path to initramfs.conf file in postinst which was preventing
+ initramfs updates for qlogic (and now bnx2) fw, closes: #432042
+
+ -- dann frazier <dannf@debian.org> Wed, 04 Jun 2008 01:33:43 -0600
+
firmware-nonfree (0.4etch1) stable; urgency=high

* Build-depend on linux-support-2.6.18-6; closes: #468215.
Index: debian/templates/postinst.initramfs-tools.in
================================================== =================
--- debian/templates/postinst.initramfs-tools.in (.../releases/firmware-nonfree/0.4etch1) (revision 11527)
+++ debian/templates/postinst.initramfs-tools.in (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -4,7 +4,7 @@

case "$1" in
configure)
- if [ -x /usr/sbin/update-initramfs -a -e /etc/mkinitramfs/initramfs.conf ] ; then
+ if [ -x /usr/sbin/update-initramfs -a -e /etc/initramfs-tools/initramfs.conf ] ; then
update-initramfs -u
fi
;;
Index: bnx2/LICENSE
================================================== =================
--- bnx2/LICENSE (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/LICENSE (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,7 @@
+This file contains firmware data derived from proprietary unpublished
+source code, Copyright (c) 2004, 2005, 2006, 2007 Broadcom Corporation.
+
+Permission is hereby granted for the distribution of this firmware data
+in hexadecimal or equivalent format, provided this copyright notice is
+accompanying it.
+
Index: bnx2/fwcutter/bnx2_fwcutter_2.6.25.c
================================================== =================
--- bnx2/fwcutter/bnx2_fwcutter_2.6.25.c (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/fwcutter/bnx2_fwcutter_2.6.25.c (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,24 @@
+#include "bnx2_fwcutter.c"
+
+int main()
+{
+ write_firmware("bnx2-06-4.0.5.fw",
+ &bnx2_com_fw_06,
+ &bnx2_cp_fw_06,
+ &bnx2_rxp_fw_06,
+ &bnx2_tpat_fw_06,
+ &bnx2_txp_fw_06,
+ bnx2_rv2p_proc1, sizeof bnx2_rv2p_proc1,
+ bnx2_rv2p_proc2, sizeof bnx2_rv2p_proc2);
+ write_firmware("bnx2-09-4.0.5.fw",
+ &bnx2_com_fw_09,
+ &bnx2_cp_fw_09,
+ &bnx2_rxp_fw_09,
+ &bnx2_tpat_fw_09,
+ &bnx2_txp_fw_09,
+ bnx2_xi_rv2p_proc1, sizeof bnx2_xi_rv2p_proc2,
+ bnx2_xi_rv2p_proc2, sizeof bnx2_xi_rv2p_proc2);
+
+ return EXIT_SUCCESS;
+}
+
Index: bnx2/fwcutter/bnx2_fw_file.h
================================================== =================
--- bnx2/fwcutter/bnx2_fw_file.h (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/fwcutter/bnx2_fw_file.h (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,25 @@
+struct bnx2_fw_file_section {
+ uint32_t addr;
+ uint32_t len;
+ uint32_t offset;
+};
+
+struct bnx2_fw_file_entry {
+ uint32_t start_addr;
+ struct bnx2_fw_file_section text;
+ struct bnx2_fw_file_section data;
+ struct bnx2_fw_file_section sbss;
+ struct bnx2_fw_file_section bss;
+ struct bnx2_fw_file_section rodata;
+};
+
+struct bnx2_fw_file {
+ struct bnx2_fw_file_entry com;
+ struct bnx2_fw_file_entry cp;
+ struct bnx2_fw_file_entry rxp;
+ struct bnx2_fw_file_entry tpat;
+ struct bnx2_fw_file_entry txp;
+ struct bnx2_fw_file_section rv2p_proc1;
+ struct bnx2_fw_file_section rv2p_proc2;
+};
+
Index: bnx2/fwcutter/Makefile
================================================== =================
--- bnx2/fwcutter/Makefile (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/fwcutter/Makefile (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,15 @@
+ifndef KERNEL_SOURCE
+$(error Please define KERNEL_SOURCE)
+endif
+ifndef KERNEL_VERSION
+$(error Please define KERNEL_VERSION)
+endif
+
+CFLAGS += -I$(KERNEL_SOURCE)/drivers/net
+CFLAGS += --std=gnu99
+LDFLAGS += -lz
+
+all: bnx2_fwcutter_$(KERNEL_VERSION)
+
+bnx2_fwcutter_$(KERNEL_VERSION): bnx2_fwcutter_$(KERNEL_VERSION).c
+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
Index: bnx2/fwcutter/bnx2_fwcutter.c
================================================== =================
--- bnx2/fwcutter/bnx2_fwcutter.c (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/fwcutter/bnx2_fwcutter.c (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,177 @@
+#include <assert.h>
+#include <byteswap.h>
+#include <endian.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <stdint.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <zlib.h>
+
+#include "bnx2_fw_file.h"
+
+struct fw_info {
+ const uint32_t ver_major;
+ const uint32_t ver_minor;
+ const uint32_t ver_fix;
+
+ const uint32_t start_addr;
+
+ /* Text section. */
+ const uint32_t text_addr;
+ const uint32_t text_len;
+ const uint32_t text_index;
+ void *text;
+ const void *gz_text;
+ const uint32_t gz_text_len;
+
+ /* Data section. */
+ const uint32_t data_addr;
+ const uint32_t data_len;
+ const uint32_t data_index;
+ const uint32_t *data;
+
+ /* SBSS section. */
+ const uint32_t sbss_addr;
+ const uint32_t sbss_len;
+ const uint32_t sbss_index;
+
+ /* BSS section. */
+ const uint32_t bss_addr;
+ const uint32_t bss_len;
+ const uint32_t bss_index;
+
+ /* Read-only section. */
+ const uint32_t rodata_addr;
+ const uint32_t rodata_len;
+ const uint32_t rodata_index;
+ const uint32_t *rodata;
+};
+
+typedef uint8_t u8;
+typedef uint32_t u32;
+
+#include "bnx2_fw.h"
+#include "bnx2_fw2.h"
+
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+#define cpu_to_be32(x) bswap_32(x)
+#elif __BYTE_ORDER == __BIG_ENDIAN
+#define cpu_to_be32(x) (x)
+#endif
+#define le32_to_be32(x) bswap_32(x)
+
+void set_firmware_image_part(struct bnx2_fw_file_section *s, uint32_t addr, uint32_t len)
+{
+ s->addr = cpu_to_be32(addr);
+ s->len = cpu_to_be32(len);
+}
+
+void write_firmware_flat(int fd, struct bnx2_fw_file_section *out, void *data, int len)
+{
+ off_t offset = lseek(fd, 0, SEEK_CUR);
+
+ uint32_t buf[0x10000];
+ struct z_stream_s strm;
+ memset(&strm, 0, sizeof strm);
+
+ strm.next_in = (void *)data;
+ strm.avail_in = len;
+ strm.next_out = (void *)buf;
+ strm.avail_out = sizeof buf;
+
+ int ret = inflateInit2(&strm, -MAX_WBITS);
+ assert(ret == Z_OK);
+ ret = inflate(&strm, Z_FINISH);
+ assert(ret == Z_STREAM_END);
+ unsigned int l = strm.total_out;
+
+ out->len = cpu_to_be32(l);
+ out->offset = cpu_to_be32(offset);
+
+ inflateEnd(&strm);
+
+ for (unsigned int j = 0; j < (l / 4); j++)
+ buf[j] = le32_to_be32(buf[j]);
+ write(fd, buf, l);
+}
+
+void write_firmware_image(int fd, struct bnx2_fw_file_entry *out, struct fw_info *fw)
+{
+ off_t offset = lseek(fd, 0, SEEK_CUR);
+
+ out->start_addr = cpu_to_be32(fw->start_addr);
+
+ set_firmware_image_part(&out->text, fw->text_addr, fw->text_len);
+ out->text.offset = cpu_to_be32(offset);
+
+ uint32_t buf[0x10000];
+ struct z_stream_s strm;
+ memset(&strm, 0, sizeof strm);
+
+ strm.next_in = (void *)fw->gz_text;
+ strm.avail_in = fw->gz_text_len;
+ strm.next_out = (void *)buf;
+ strm.avail_out = sizeof buf;
+
+ int ret = inflateInit2(&strm, -MAX_WBITS);
+ assert(ret == Z_OK);
+ ret = inflate(&strm, Z_FINISH);
+ assert(ret == Z_STREAM_END);
+ inflateEnd(&strm);
+
+ for (unsigned int j = 0; j < (fw->text_len / 4); j++)
+ buf[j] = le32_to_be32(buf[j]);
+ offset += write(fd, buf, fw->text_len);
+
+ if (fw->data_addr)
+ {
+ set_firmware_image_part(&out->data, fw->data_addr, fw->data_len);
+ out->data.offset = cpu_to_be32(offset);
+ for (unsigned int j = 0; j < (fw->data_len / 4); j++)
+ buf[j] = cpu_to_be32(fw->data[j]);
+ offset += write(fd, buf, fw->data_len);
+ }
+
+ if (fw->sbss_len)
+ set_firmware_image_part(&out->sbss, fw->sbss_addr, fw->sbss_len);
+
+ if (fw->bss_len)
+ set_firmware_image_part(&out->bss, fw->bss_addr, fw->bss_len);
+
+ if (fw->rodata_addr)
+ {
+ set_firmware_image_part(&out->rodata, fw->rodata_addr, fw->rodata_len);
+ out->rodata.offset = cpu_to_be32(offset);
+ for (unsigned int j = 0; j < (fw->rodata_len / 4); j++)
+ buf[j] = cpu_to_be32(fw->rodata[j]);
+ offset += write(fd, buf, fw->rodata_len);
+ }
+}
+
+void write_firmware(const char *filename, struct fw_info *com_fw, struct fw_info *cp_fw, struct fw_info *rxp_fw, struct fw_info *tpat_fw, struct fw_info *txp_fw, void *rv2p_proc1, int rv2p_proc1_len, void *rv2p_proc2, int rv2p_proc2_len)
+{
+ struct bnx2_fw_file out;
+ memset(&out, 0, sizeof out);
+
+ int fd = open(filename, O_WRONLY | O_CREAT, 0666);
+
+ lseek(fd, sizeof out, SEEK_SET);
+
+ write_firmware_image(fd, &out.com, com_fw);
+ write_firmware_image(fd, &out.cp, cp_fw);
+ write_firmware_image(fd, &out.rxp, rxp_fw);
+ write_firmware_image(fd, &out.tpat, tpat_fw);
+ write_firmware_image(fd, &out.txp, txp_fw);
+ write_firmware_flat(fd, &out.rv2p_proc1, rv2p_proc1, rv2p_proc1_len);
+ write_firmware_flat(fd, &out.rv2p_proc2, rv2p_proc2, rv2p_proc2_len);
+
+ lseek(fd, 0, SEEK_SET);
+
+ write(fd, &out, sizeof out);
+
+ close(fd);
+}
+
Index: bnx2/bnx2-06-4.0.5.fw
================================================== =================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: bnx2/bnx2-06-4.0.5.fw
__________________________________________________ _________________
Name: svn:mime-type
+ application/octet-stream

Index: bnx2/bnx2-09-4.0.5.fw
================================================== =================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: bnx2/bnx2-09-4.0.5.fw
__________________________________________________ _________________
Name: svn:mime-type
+ application/octet-stream

Index: bnx2/defines
================================================== =================
--- bnx2/defines (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ bnx2/defines (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,16 @@
+[base]
+desc: Broadcom NetXtremeII
+files:
+ bnx2-06-4.0.5.fw
+ bnx2-09-4.0.5.fw
+longdesc: Broadcom NetXtremeII network adapters
+support: initramfs-tools
+uri: http://ftp.debian.org/debian/pool/non-free/f/firmware-nonfree
+
+[bnx2-06-4.0.5.fw_base]
+desc: Broadcom NetXtremeII 5706 firmware
+version: Linux 2.6.25
+
+[bnx2-09-4.0.5.fw_base]
+desc: Broadcom NetXtremeII 5709 firmware
+version: Linux 2.6.25
Index: iwlwifi/LICENSE
================================================== =================
--- iwlwifi/LICENSE (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ iwlwifi/LICENSE (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,39 @@
+Copyright (c) 2006, Intel Corporation.
+All rights reserved.
+
+Redistribution. Redistribution and use in binary form, without
+modification, are permitted provided that the following conditions are
+met:
+
+* Redistributions must reproduce the above copyright notice and the
+ following disclaimer in the documentation and/or other materials
+ provided with the distribution.
+* Neither the name of Intel Corporation nor the names of its suppliers
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+* No reverse engineering, decompilation, or disassembly of this software
+ is permitted.
+
+Limited patent license. Intel Corporation grants a world-wide,
+royalty-free, non-exclusive license under patents it now or hereafter
+owns or controls to make, have made, use, import, offer to sell and
+sell ("Utilize") this software, but solely to the extent that any
+such patent is necessary to Utilize the software alone, or in
+combination with an operating system licensed under an approved Open
+Source license as listed by the Open Source Initiative at
+http://opensource.org/licenses. The patent license shall not apply to
+any other combinations which include this software. No hardware per
+se is licensed hereunder.
+
+DISCLAIMER. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
Index: iwlwifi/iwlwifi-3945-1.ucode
================================================== =================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: iwlwifi/iwlwifi-3945-1.ucode
__________________________________________________ _________________
Name: svn:mime-type
+ application/octet-stream

Index: iwlwifi/iwlwifi-4965-1.ucode
================================================== =================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: iwlwifi/iwlwifi-4965-1.ucode
__________________________________________________ _________________
Name: svn:mime-type
+ application/octet-stream

Index: iwlwifi/update.sh
================================================== =================
--- iwlwifi/update.sh (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ iwlwifi/update.sh (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,14 @@
+#!/bin/sh
+
+version="$1"
+url="$2"
+
+mkdir update
+curl -o update/ucode.tgz "$url"
+
+tar -C update -xzf update/ucode.tgz
+file="$(tar -tzf update/ucode.tgz | grep -e ".ucode$")"
+file_real="${file#*/}"
+mv update/"$file" "$file_real"-"$version"
+
+rm update -rf

Property changes on: iwlwifi/update.sh
__________________________________________________ _________________
Name: svn:executable
+ *

Index: iwlwifi/defines
================================================== =================
--- iwlwifi/defines (.../releases/firmware-nonfree/0.4etch1) (revision 0)
+++ iwlwifi/defines (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -0,0 +1,13 @@
+[base]
+desc: Intel Wireless 3945 and 4965
+files:
+ iwlwifi-3945-1.ucode
+ iwlwifi-4965-1.ucode
+longdesc: Intel Wireless 3945 and 4965 cards
+uri: http://intellinuxwireless.org/?p=iwlwifi&n=downloads
+
+[iwlwifi-3945-1.ucode_base]
+desc: Intel Wireless 3945 firmware
+
+[iwlwifi-4965-1.ucode_base]
+desc: Intel Wireless 4965 firmware
Index: defines
================================================== =================
--- defines (.../releases/firmware-nonfree/0.4etch1) (revision 11527)
+++ defines (.../dists/etch/firmware-nonfree) (revision 11527)
@@ -1,4 +1,6 @@
[base]
packages:
+ bnx2
+ iwlwifi
ipw3945
qlogic


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 06-09-2008, 10:11 PM
Luk Claes
 
Default firmware-nonfree update for etchnhalf

dann frazier wrote:
> I'd like to propose the following update for stable.
>
> I've tested on an etch laptop w/ built-in intel 3945 wireless and a
> server w/ a bnx2 nic under both etch and etchnhalf.

Please upload.

Cheers

Luk


--
To UNSUBSCRIBE, email to debian-kernel-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 

Thread Tools




All times are GMT. The time now is 08:10 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org