Re: [tlan] 2.1.110 compiling error

James Banks (james@sovereign.org)
Thu, 23 Jul 1998 03:00:59 -0600


--6zdv2QT/q3FMhpsV
Content-Type: text/plain; charset=us-ascii

Well, how 'bout that. The ol' look before you leap snafu strikes again.

Anyway, I would appreciate it if I could get feedback on the enclosed
patch (based on the previous changes made to the driver for 2.1). If
it checks out, I'll send it to Linus for inclusion in the next kernel
release.

Thanks,
James

On Wed, Jul 22, 1998 at 12:16:59PM -0700, bryan sebastian kiechle wrote:
> if you remove the FREE_WRITE from any referance to dev_kfree_skb in the
> tlan.c file this problem goes away, most of the time. As in:
>
> if ( ! priv->phyOnline ) {
> TLAN_DBG( TLAN_DEBUG_TX, "TLAN TRANSMIT: %s PHY is not ready\n$
> dev_kfree_skb( skb, FREE_WRITE );
> return 0; ^^^^^^^^^^^^
>
> As told to me by brian@goober.wireless.ucsc.edu
>
> On Wed, 22 Jul 1998, Xintian Wu wrote:
>
> >
> > gcc -D__KERNEL__ -I/usr/src/linux-2.1.110/include -Wall -Wstrict-prototypes -O2
> > -fomit-frame-pointer -D__SMP__ -pipe -fno-strength-reduce -m486 -malign-loops=2
> > -malign-jumps=2 -malign-functions=2 -DCPU=586 -c -o tlan.o tlan.c
> > In file included from tlan.c:35:
> > /usr/src/linux-2.1.110/include/linux/bios32.h:11: warning: #warning This driver
> > uses the old PCI interface, please fix it (see Documentation/pci.txt)
> > tlan.c:782: macro `dev_kfree_skb' used with too many (2) args
> > tlan.c:840: macro `dev_kfree_skb' used with too many (2) args
> > tlan.c:1129: macro `dev_kfree_skb' used with too many (2) args
> > tlan.c:1695: macro `dev_kfree_skb' used with too many (2) args
> > tlan.c:1704: macro `dev_kfree_skb' used with too many (2) args
> > tlan.c: In function `TLan_MiiSendData':
> > tlan.c:2535: warning: value computed is not used
> > tlan.c:2541: warning: value computed is not used
> > tlan.c: At top level:
> > tlan.c:55: warning: `aui' defined but not used
> > tlan.c:56: warning: `sa_int' defined but not used
> > tlan.c:58: warning: `duplex' defined but not used
> > tlan.c:59: warning: `speed' defined but not used
> > make[3]: *** [tlan.o] Error 1
> > make[3]: Leaving directory `/usr/src/linux-2.1.110/drivers/net'
> > make[2]: *** [first_rule] Error 2
> > make[2]: Leaving directory `/usr/src/linux-2.1.110/drivers/net'
> > make[1]: *** [sub_dirs] Error 2
> > make[1]: Leaving directory `/usr/src/linux-2.1.110/drivers'
> > make: *** [linuxsubdirs] Error 2
> >
> >
>
> ==================================================================
> bryan sebastian kiechle
> crain@goober.wireless.ucsc.edu http://www.outcast.org/~thinboy
> ------------------------------------------------------------------
> Genetic Memories Fri. 11:00pm-1:00am KZSC Santa Cruz 88.1 FM
> http://www.outcast.org/~thinboy/genmem

--6zdv2QT/q3FMhpsV
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="tlan-110.patch"

--- tlan-1.0.old/tlan.c Thu Jul 23 02:16:59 1998
+++ tlan-1.0/tlan.c Thu Jul 23 02:10:45 1998
@@ -32,7 +32,6 @@

#include "tlan.h"

-#include <linux/bios32.h>
#include <linux/ioport.h>
#include <linux/pci.h>
#include <linux/etherdevice.h>
@@ -151,7 +150,7 @@
};


-static int TLan_PciProbe( u8 *, u8 *, u8 *, u8 *, u32 *, u32 * );
+static int TLan_PciProbe( u8 *, u8 *, int *, u8 *, u32 *, u32 * );
static int TLan_Init( struct device * );
static int TLan_Open(struct device *dev);
static int TLan_StartTx(struct sk_buff *, struct device *);
@@ -276,7 +275,7 @@
int failed;
int found;
u32 io_base;
- u8 irq;
+ int irq;
u8 rev;

printk( "TLAN driver, v%d.%d, (C) 1997-8 Caldera, Inc.\n",
@@ -416,7 +415,8 @@
TLanPrivateInfo *priv;
static int pad_allocated = 0;
int found;
- u8 bus, dfn, irq, rev;
+ u8 bus, dfn, rev;
+ int irq;
u32 io_base, index;

found = TLan_PciProbe( &bus, &dfn, &irq, &rev, &io_base, &index );
@@ -436,7 +436,6 @@

if ( ! pad_allocated ) {
TLanPadBuffer = (u8 *) kmalloc( TLAN_MIN_FRAME_SIZE,
-// ( GFP_KERNEL | GFP_DMA )
( GFP_KERNEL )
);
if ( TLanPadBuffer == NULL ) {
@@ -521,7 +520,7 @@
*
**************************************************************/

-int TLan_PciProbe( u8 *pci_bus, u8 *pci_dfn, u8 *pci_irq, u8 *pci_rev, u32 *pci_io_base, u32 *dl_ix )
+int TLan_PciProbe( u8 *pci_bus, u8 *pci_dfn, int *pci_irq, u8 *pci_rev, u32 *pci_io_base, u32 *dl_ix )
{
static int dl_index = 0;
static int pci_index = 0;
@@ -532,7 +531,7 @@
int reg;


- if ( ! pcibios_present() ) {
+ if ( ! pci_present() ) {
printk( "TLAN: PCI Bios not present.\n" );
return 0;
}
@@ -548,6 +547,7 @@
);

if ( ! not_found ) {
+ struct pci_dev *pdev = pci_find_slot(*pci_bus, *pci_dfn);

TLAN_DBG(
TLAN_DEBUG_GNRL,
@@ -556,19 +556,19 @@
TLanAdapterList[dl_index].deviceId
);

- pcibios_read_config_byte ( *pci_bus, *pci_dfn, PCI_REVISION_ID, pci_rev);
- pcibios_read_config_byte ( *pci_bus, *pci_dfn, PCI_INTERRUPT_LINE, pci_irq);
- pcibios_read_config_word ( *pci_bus, *pci_dfn, PCI_COMMAND, &pci_command);
- pcibios_read_config_dword( *pci_bus, *pci_dfn, PCI_BASE_ADDRESS_0, pci_io_base);
- pcibios_read_config_byte ( *pci_bus, *pci_dfn, PCI_LATENCY_TIMER, &pci_latency);
+ pci_read_config_byte ( pdev, PCI_REVISION_ID, pci_rev);
+ *pci_irq = pdev->irq;
+ pci_read_config_word ( pdev, PCI_COMMAND, &pci_command);
+ pci_read_config_byte ( pdev, PCI_LATENCY_TIMER, &pci_latency);
+

if (pci_latency < 0x10) {
- pcibios_write_config_byte( *pci_bus, *pci_dfn, PCI_LATENCY_TIMER, 0xff);
+ pci_write_config_byte( pdev, PCI_LATENCY_TIMER, 0xff);
TLAN_DBG( TLAN_DEBUG_GNRL, "TLAN: Setting latency timer to max.\n");
}

- for ( reg = PCI_BASE_ADDRESS_0; reg <= PCI_BASE_ADDRESS_5; reg +=4 ) {
- pcibios_read_config_dword( *pci_bus, *pci_dfn, reg, pci_io_base);
+ for ( reg = 0; reg <= 5; reg ++ ) {
+ *pci_io_base = pdev->base_address[reg];
if ((pci_command & PCI_COMMAND_IO) && (*pci_io_base & 0x3)) {
*pci_io_base &= PCI_BASE_ADDRESS_IO_MASK;
TLAN_DBG( TLAN_DEBUG_GNRL, "TLAN: IO mapping is available at %x.\n", *pci_io_base);
@@ -582,7 +582,7 @@
printk("TLAN: IO mapping not available, ignoring device.\n");

if ( ! ( pci_command & PCI_COMMAND_MASTER ) ) {
- pcibios_write_config_word ( *pci_bus, *pci_dfn, PCI_COMMAND, pci_command | PCI_COMMAND_MASTER );
+ pci_write_config_word ( pdev, PCI_COMMAND, pci_command | PCI_COMMAND_MASTER );
printk( "TLAN: Activating PCI bus mastering for this device.\n" );
}

@@ -779,7 +779,7 @@

if ( ! priv->phyOnline ) {
TLAN_DBG( TLAN_DEBUG_TX, "TLAN TRANSMIT: %s PHY is not ready\n", dev->name );
- dev_kfree_skb( skb, FREE_WRITE );
+ dev_kfree_skb( skb );
return 0;
}

@@ -837,7 +837,7 @@
CIRC_INC( priv->txTail, TLAN_NUM_TX_LISTS );

if ( bbuf ) {
- dev_kfree_skb( skb, FREE_WRITE );
+ dev_kfree_skb( skb );
}

dev->trans_start = jiffies;
@@ -1126,7 +1126,7 @@
head_list = priv->txList + priv->txHead;

if ( ! bbuf ) {
- dev_kfree_skb( (struct sk_buff *) head_list->buffer[9].address, FREE_WRITE );
+ dev_kfree_skb( (struct sk_buff *) head_list->buffer[9].address );
head_list->buffer[9].address = 0;
}

@@ -1220,7 +1220,7 @@
* of the list. If the frame was the last in the Rx
* channel (EOC), the function restarts the receive channel
* by sending an Rx Go command to the adapter. Then it
- * activates/continues the the activity LED.
+ * activates/continues the activity LED.
*
**************************************************************/

@@ -1692,7 +1692,7 @@
list = priv->txList + i;
skb = (struct sk_buff *) list->buffer[9].address;
if ( skb ) {
- dev_kfree_skb( skb, FREE_WRITE );
+ dev_kfree_skb( skb );
list->buffer[9].address = 0;
}
}
@@ -1701,7 +1701,7 @@
list = priv->rxList + i;
skb = (struct sk_buff *) list->buffer[9].address;
if ( skb ) {
- dev_kfree_skb( skb, FREE_READ );
+ dev_kfree_skb( skb );
list->buffer[9].address = 0;
}
}
@@ -1721,7 +1721,7 @@
* io_base Base IO port of the device of
* which to print DIO registers.
*
- * This function prints out all the the internal (DIO)
+ * This function prints out all the internal (DIO)
* registers of a TLAN chip.
*
**************************************************************/
@@ -2030,7 +2030,7 @@
* areg The AREG to set the address in (0 - 3).
* mac A pointer to an array of chars. Each
* element stores one byte of the address.
- * IE, it isn't in ascii.
+ * That is, it isn't in ascii.
*
* This function transfers a MAC address to one of the
* TLAN AREGs (address registers). The TLAN chip locks
@@ -2812,7 +2812,7 @@
*
* Returns:
* No error = 0, else, the stage at which the error
- * occured.
+ * occurred.
* Parms:
* io_base The IO port base address for the
* TLAN device with the EEPROM to

--6zdv2QT/q3FMhpsV--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html