diff -Nup ipw2100-1.1.0-orig/ieee80211.h ipw2100-1.1.0/ieee80211.h --- ipw2100-1.1.0-orig/ieee80211.h 2005-03-14 10:54:24.000000000 -0600 +++ ipw2100-1.1.0/ieee80211.h 2005-10-18 10:59:01.000000000 -0500 @@ -642,17 +642,13 @@ enum ieee80211_state { #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" #define MAC_ARG(x) ((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5] - -extern inline int is_multicast_ether_addr(const u8 *addr) +#include /* KERNEL_VERSION */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,12) +extern static inline int is_multicast_ether_addr(const u8 *addr) { - return ((addr[0] != 0xff) && (0x01 & addr[0])); -} - -extern inline int is_broadcast_ether_addr(const u8 *addr) -{ - return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \ - (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); + return addr[0] & 0x01; } +#endif #define CFG_IEEE80211_RESERVE_FCS BIT(0) #define CFG_IEEE80211_COMPUTE_FCS BIT(1) diff -Nup ipw2100-1.1.0-orig/ieee80211_tx.c ipw2100-1.1.0/ieee80211_tx.c --- ipw2100-1.1.0-orig/ieee80211_tx.c 2005-03-14 10:54:24.000000000 -0600 +++ ipw2100-1.1.0/ieee80211_tx.c 2005-10-18 10:59:01.000000000 -0500 @@ -244,6 +244,12 @@ struct ieee80211_txb *ieee80211_alloc_tx return txb; } +static inline int ieee80211_is_broadcast_ether_addr(u8 *addr) +{ + return ((addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & + addr[5]) == 0xff); +} + /* SKBs are added to the ieee->tx_queue. */ int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev) @@ -351,7 +357,7 @@ int ieee80211_xmit(struct sk_buff *skb, /* Determine fragmentation size based on destination (multicast * and broadcast are not fragmented) */ if (is_multicast_ether_addr(dest) || - is_broadcast_ether_addr(dest)) + ieee80211_is_broadcast_ether_addr(dest)) frag_size = MAX_FRAG_THRESHOLD; else frag_size = ieee->fts; diff -Nup ipw2100-1.1.0-orig/ipw2100.c ipw2100-1.1.0/ipw2100.c --- ipw2100-1.1.0-orig/ipw2100.c 2005-03-14 10:54:25.000000000 -0600 +++ ipw2100-1.1.0/ipw2100.c 2005-10-18 10:59:01.000000000 -0500 @@ -284,7 +284,6 @@ static const char *command_types[] = { }; #endif - /* Pre-decl until we get the code solid and then we can clean it up */ static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv); static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv); @@ -493,7 +492,7 @@ int ipw2100_get_ordinal(struct ipw2100_p *len = IPW_ORD_TAB_1_ENTRY_SIZE; IPW_DEBUG_WARNING(DRV_NAME - ": ordinal buffer length too small, need %d\n", + ": ordinal buffer length too small, need %zd\n", IPW_ORD_TAB_1_ENTRY_SIZE); return -EINVAL; @@ -2302,7 +2301,7 @@ static inline void ipw2100_corruption_de #endif IPW_DEBUG_INFO(DRV_NAME ": PCI latency error detected at " - "0x%04X.\n", i * sizeof(struct ipw2100_status)); + "0x%04zX.\n", i * sizeof(struct ipw2100_status)); #ifdef ACPI_CSTATE_LIMIT_DEFINED IPW_DEBUG_INFO(DRV_NAME ": Disabling C3 transitions.\n"); @@ -2398,7 +2397,7 @@ static inline void isr_rx(struct ipw2100 /* Make a copy of the frame so we can dump it to the logs if * ieee80211_rx fails */ memcpy(packet_data, packet->skb->data, - min(status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); + min_t(u32, status->frame_size, IPW_RX_NIC_BUFFER_LENGTH)); #endif if (!ieee80211_rx(priv->ieee, packet->skb, stats)) { @@ -2730,21 +2729,20 @@ static inline int __ipw2100_tx_process(s { int i = txq->oldest; IPW_DEBUG_TX( - "TX%d V=%p P=%p T=%p L=%d\n", i, + "TX%d V=%p P=%04X T=%04X L=%d\n", i, &txq->drv[i], - (void*)txq->nic + i * sizeof(struct ipw2100_bd), - (void*)txq->drv[i].host_addr, - txq->drv[i].buf_length); + (u32)(txq->nic + i * sizeof(struct ipw2100_bd)), + txq->drv[i].host_addr, txq->drv[i].buf_length); if (packet->type == DATA) { i = (i + 1) % txq->entries; IPW_DEBUG_TX( - "TX%d V=%p P=%p T=%p L=%d\n", i, + "TX%d V=%p P=%04X T=%04X L=%d\n", i, &txq->drv[i], - (void*)txq->nic + i * - sizeof(struct ipw2100_bd), - (void*)txq->drv[i].host_addr, + (u32)(txq->nic + i * + sizeof(struct ipw2100_bd)), + txq->drv[i].host_addr, txq->drv[i].buf_length); } } @@ -3383,7 +3381,11 @@ static void ipw2100_msg_free(struct ipw2 priv->msg_buffers = NULL; } -static ssize_t show_pci(struct device *d, char *buf) +static ssize_t show_pci(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct pci_dev *pci_dev = container_of(d, struct pci_dev, dev); char *out = buf; @@ -3403,21 +3405,33 @@ static ssize_t show_pci(struct device *d } static DEVICE_ATTR(pci, S_IRUGO, show_pci, NULL); -static ssize_t show_cfg(struct device *d, char *buf) +static ssize_t show_cfg(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->config); } static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL); -static ssize_t show_status(struct device *d, char *buf) +static ssize_t show_status(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->status); } static DEVICE_ATTR(status, S_IRUGO, show_status, NULL); -static ssize_t show_capability(struct device *d, char *buf) +static ssize_t show_capability(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *p = (struct ipw2100_priv *)d->driver_data; return sprintf(buf, "0x%08x\n", (int)p->capability); @@ -3602,7 +3616,11 @@ const struct { }; -static ssize_t show_registers(struct device *d, char *buf) +static ssize_t show_registers(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { int i; struct ipw2100_priv *priv = dev_get_drvdata(d); @@ -3623,7 +3641,11 @@ static ssize_t show_registers(struct dev static DEVICE_ATTR(registers, S_IRUGO, show_registers, NULL); -static ssize_t show_hardware(struct device *d, char *buf) +static ssize_t show_hardware(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3663,7 +3685,11 @@ static ssize_t show_hardware(struct devi static DEVICE_ATTR(hardware, S_IRUGO, show_hardware, NULL); -static ssize_t show_memory(struct device *d, char *buf) +static ssize_t show_memory(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3716,7 +3742,11 @@ static ssize_t show_memory(struct device return len; } -static ssize_t store_memory(struct device *d, const char *buf, size_t count) +static ssize_t store_memory(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -3752,7 +3782,11 @@ static ssize_t store_memory(struct devic static DEVICE_ATTR(memory, S_IWUSR|S_IRUGO, show_memory, store_memory); -static ssize_t show_ordinals(struct device *d, char *buf) +static ssize_t show_ordinals(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); u32 val = 0; @@ -3786,7 +3820,11 @@ static ssize_t show_ordinals(struct devi static DEVICE_ATTR(ordinals, S_IRUGO, show_ordinals, NULL); -static ssize_t show_stats(struct device *d, char *buf) +static ssize_t show_stats(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char * out = buf; @@ -3851,7 +3889,11 @@ int ipw2100_switch_mode(struct ipw2100_p return 0; } -static ssize_t show_internals(struct device *d, char *buf) +static ssize_t show_internals(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); int len = 0; @@ -3902,7 +3944,11 @@ static ssize_t show_internals(struct dev static DEVICE_ATTR(internals, S_IRUGO, show_internals, NULL); -static ssize_t show_bssinfo(struct device *d, char *buf) +static ssize_t show_bssinfo(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char essid[IW_ESSID_MAX_SIZE + 1]; @@ -3979,7 +4025,11 @@ static DRIVER_ATTR(debug_level, S_IWUSR #endif /* CONFIG_IPW_DEBUG */ -static ssize_t show_fatal_error(struct device *d, char *buf) +static ssize_t show_fatal_error(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); char *out = buf; @@ -4004,7 +4054,11 @@ static ssize_t show_fatal_error(struct d return out - buf; } -static ssize_t store_fatal_error(struct device *d, const char *buf, +static ssize_t store_fatal_error(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); @@ -4014,13 +4068,21 @@ static ssize_t store_fatal_error(struct static DEVICE_ATTR(fatal_error, S_IWUSR|S_IRUGO, show_fatal_error, store_fatal_error); -static ssize_t show_scan_age(struct device *d, char *buf) +static ssize_t show_scan_age(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { struct ipw2100_priv *priv = dev_get_drvdata(d); return sprintf(buf, "%d\n", priv->ieee->scan_age); } -static ssize_t store_scan_age(struct device *d, const char *buf, size_t count) +static ssize_t store_scan_age(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); struct net_device *dev = priv->net_dev; @@ -4056,7 +4118,11 @@ static ssize_t store_scan_age(struct dev static DEVICE_ATTR(scan_age, S_IWUSR | S_IRUGO, show_scan_age, store_scan_age); -static ssize_t show_rf_kill(struct device *d, char *buf) +static ssize_t show_rf_kill(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + char *buf) { /* 0 - RF kill not enabled 1 - SW based RF kill active (sysfs) @@ -4100,7 +4166,11 @@ static int ipw_radio_kill_sw(struct ipw2 return 1; } -static ssize_t store_rf_kill(struct device *d, const char *buf, size_t count) +static ssize_t store_rf_kill(struct device *d, +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,12) +struct device_attribute *attr, +#endif + const char *buf, size_t count) { struct ipw2100_priv *priv = dev_get_drvdata(d); ipw_radio_kill_sw(priv, buf[0] == '1'); @@ -4212,7 +4282,8 @@ static void bd_queue_initialize( { IPW_DEBUG_INFO("enter\n"); - IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", q->drv, q->nic); + IPW_DEBUG_INFO("initializing bd queue at virt=%p, phys=%08x\n", + q->drv, (u32)q->nic); write_register(priv->net_dev, base, q->nic); write_register(priv->net_dev, size, q->entries); @@ -8431,7 +8502,7 @@ int ipw2100_get_firmware(struct ipw2100_ priv->net_dev->name, fw_name); return rc; } - IPW_DEBUG_INFO("firmware data %p size %d\n", fw->fw_entry->data, + IPW_DEBUG_INFO("firmware data %p size %zd\n", fw->fw_entry->data, fw->fw_entry->size); ipw2100_mod_firmware_load(fw);