diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-27 16:49:18 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-01-27 16:49:18 -0800 |
| commit | 111fd6e66e29d3546b70c72d44b960cafac76526 (patch) | |
| tree | b485c3f4f80ca6902f927747de793361f8ba7fb9 | |
| parent | f653687e4192a31f6a06bb8ef7401c9120d021cd (diff) | |
| download | patches-111fd6e66e29d3546b70c72d44b960cafac76526.tar.gz | |
lots of staging, one driver core, and 3 usb/kfifo patches
39 files changed, 5931 insertions, 0 deletions
diff --git a/driver-core/driver-core-constify-struct-sysfs_ops-in-struct-kobj_type.patch b/driver-core/driver-core-constify-struct-sysfs_ops-in-struct-kobj_type.patch new file mode 100644 index 00000000000000..9b4d2f65d08902 --- /dev/null +++ b/driver-core/driver-core-constify-struct-sysfs_ops-in-struct-kobj_type.patch @@ -0,0 +1,826 @@ +From re.emese@gmail.com Wed Jan 27 15:54:13 2010 +From: Emese Revfy <re.emese@gmail.com> +Date: Tue, 19 Jan 2010 02:58:23 +0100 +Subject: Driver core: Constify struct sysfs_ops in struct kobj_type +To: Greg KH <gregkh@suse.de> +Cc: Al Viro <viro@ZenIV.linux.org.uk>, teigland@redhat.com, Matt_Domsch@dell.com, maciej.sosnowski@intel.com, hjk@linutronix.de, Pekka Enberg <penberg@cs.helsinki.fi>, jens.axboe@oracle.com, shemminger@vyatta.com, akpm@linux-foundation.org, davem@davemloft.net, torvalds@linux-foundation.org +Message-ID: <4B5511BF.60508@gmail.com> + + +From: Emese Revfy <re.emese@gmail.com> + +Constify struct sysfs_ops. + +This is part of the ops structure constification +effort started by Arjan van de Ven et al. + +Benefits of this constification: + + * prevents modification of data that is shared + (referenced) by many other structure instances + at runtime + + * detects/prevents accidental (but not intentional) + modification attempts on archs that enforce + read-only kernel data at runtime + + * potentially better optimized code as the compiler + can assume that the const data cannot be changed + + * the compiler/linker move const data into .rodata + and therefore exclude them from false sharing + +Signed-off-by: Emese Revfy <re.emese@gmail.com> +Acked-by: David Teigland <teigland@redhat.com> +Acked-by: Matt Domsch <Matt_Domsch@dell.com> +Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com> +Acked-by: Hans J. Koch <hjk@linutronix.de> +Acked-by: Pekka Enberg <penberg@cs.helsinki.fi> +Acked-by: Jens Axboe <jens.axboe@oracle.com> +Acked-by: Stephen Hemminger <shemminger@vyatta.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + Documentation/kobject.txt | 2 +- + arch/ia64/kernel/topology.c | 2 +- + arch/powerpc/kernel/cacheinfo.c | 2 +- + arch/sh/kernel/cpu/sh4/sq.c | 2 +- + arch/x86/kernel/cpu/intel_cacheinfo.c | 2 +- + arch/x86/kernel/cpu/mcheck/mce_amd.c | 2 +- + block/blk-integrity.c | 2 +- + block/blk-sysfs.c | 2 +- + block/elevator.c | 2 +- + drivers/base/bus.c | 4 ++-- + drivers/base/class.c | 2 +- + drivers/base/core.c | 2 +- + drivers/base/sys.c | 4 ++-- + drivers/block/pktcdvd.c | 2 +- + drivers/cpufreq/cpufreq.c | 2 +- + drivers/cpuidle/sysfs.c | 4 ++-- + drivers/dma/ioat/dma.c | 2 +- + drivers/dma/ioat/dma.h | 2 +- + drivers/edac/edac_device_sysfs.c | 6 +++--- + drivers/edac/edac_mc_sysfs.c | 4 ++-- + drivers/edac/edac_pci_sysfs.c | 4 ++-- + drivers/firmware/edd.c | 2 +- + drivers/firmware/efivars.c | 2 +- + drivers/firmware/iscsi_ibft.c | 2 +- + drivers/firmware/memmap.c | 2 +- + drivers/gpu/drm/ttm/ttm_bo.c | 2 +- + drivers/gpu/drm/ttm/ttm_memory.c | 2 +- + drivers/infiniband/core/cm.c | 2 +- + drivers/infiniband/core/sysfs.c | 2 +- + drivers/md/dm-sysfs.c | 2 +- + drivers/md/md.c | 4 ++-- + drivers/net/ibmveth.c | 2 +- + drivers/net/iseries_veth.c | 4 ++-- + drivers/parisc/pdc_stable.c | 2 +- + drivers/pci/hotplug/fakephp.c | 2 +- + drivers/pci/slot.c | 2 +- + drivers/uio/uio.c | 4 ++-- + drivers/uwb/wlp/sysfs.c | 3 +-- + drivers/video/omap2/dss/manager.c | 2 +- + drivers/video/omap2/dss/overlay.c | 2 +- + drivers/xen/sys-hypervisor.c | 2 +- + fs/btrfs/sysfs.c | 4 ++-- + fs/dlm/lockspace.c | 2 +- + fs/ext4/super.c | 2 +- + fs/gfs2/sys.c | 2 +- + fs/ocfs2/cluster/masklog.c | 2 +- + fs/sysfs/file.c | 8 ++++---- + include/linux/kobject.h | 4 ++-- + kernel/params.c | 2 +- + lib/kobject.c | 2 +- + mm/slub.c | 2 +- + net/bridge/br_private.h | 2 +- + net/bridge/br_sysfs_if.c | 2 +- + samples/kobject/kset-example.c | 2 +- + 54 files changed, 69 insertions(+), 70 deletions(-) + +--- a/arch/ia64/kernel/topology.c ++++ b/arch/ia64/kernel/topology.c +@@ -282,7 +282,7 @@ static ssize_t cache_show(struct kobject + return ret; + } + +-static struct sysfs_ops cache_sysfs_ops = { ++static const struct sysfs_ops cache_sysfs_ops = { + .show = cache_show + }; + +--- a/arch/powerpc/kernel/cacheinfo.c ++++ b/arch/powerpc/kernel/cacheinfo.c +@@ -642,7 +642,7 @@ static struct kobj_attribute *cache_inde + &cache_assoc_attr, + }; + +-static struct sysfs_ops cache_index_ops = { ++static const struct sysfs_ops cache_index_ops = { + .show = cache_index_show, + }; + +--- a/arch/sh/kernel/cpu/sh4/sq.c ++++ b/arch/sh/kernel/cpu/sh4/sq.c +@@ -327,7 +327,7 @@ static struct attribute *sq_sysfs_attrs[ + NULL, + }; + +-static struct sysfs_ops sq_sysfs_ops = { ++static const struct sysfs_ops sq_sysfs_ops = { + .show = sq_sysfs_show, + .store = sq_sysfs_store, + }; +--- a/arch/x86/kernel/cpu/intel_cacheinfo.c ++++ b/arch/x86/kernel/cpu/intel_cacheinfo.c +@@ -848,7 +848,7 @@ static ssize_t store(struct kobject *kob + return ret; + } + +-static struct sysfs_ops sysfs_ops = { ++static const struct sysfs_ops sysfs_ops = { + .show = show, + .store = store, + }; +--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c ++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c +@@ -388,7 +388,7 @@ static ssize_t store(struct kobject *kob + return ret; + } + +-static struct sysfs_ops threshold_ops = { ++static const struct sysfs_ops threshold_ops = { + .show = show, + .store = store, + }; +--- a/block/blk-integrity.c ++++ b/block/blk-integrity.c +@@ -278,7 +278,7 @@ static struct attribute *integrity_attrs + NULL, + }; + +-static struct sysfs_ops integrity_ops = { ++static const struct sysfs_ops integrity_ops = { + .show = &integrity_attr_show, + .store = &integrity_attr_store, + }; +--- a/block/blk-sysfs.c ++++ b/block/blk-sysfs.c +@@ -447,7 +447,7 @@ static void blk_release_queue(struct kob + kmem_cache_free(blk_requestq_cachep, q); + } + +-static struct sysfs_ops queue_sysfs_ops = { ++static const struct sysfs_ops queue_sysfs_ops = { + .show = queue_attr_show, + .store = queue_attr_store, + }; +--- a/block/elevator.c ++++ b/block/elevator.c +@@ -883,7 +883,7 @@ elv_attr_store(struct kobject *kobj, str + return error; + } + +-static struct sysfs_ops elv_sysfs_ops = { ++static const struct sysfs_ops elv_sysfs_ops = { + .show = elv_attr_show, + .store = elv_attr_store, + }; +--- a/Documentation/kobject.txt ++++ b/Documentation/kobject.txt +@@ -266,7 +266,7 @@ kobj_type: + + struct kobj_type { + void (*release)(struct kobject *); +- struct sysfs_ops *sysfs_ops; ++ const struct sysfs_ops *sysfs_ops; + struct attribute **default_attrs; + }; + +--- a/drivers/base/bus.c ++++ b/drivers/base/bus.c +@@ -70,7 +70,7 @@ static ssize_t drv_attr_store(struct kob + return ret; + } + +-static struct sysfs_ops driver_sysfs_ops = { ++static const struct sysfs_ops driver_sysfs_ops = { + .show = drv_attr_show, + .store = drv_attr_store, + }; +@@ -115,7 +115,7 @@ static ssize_t bus_attr_store(struct kob + return ret; + } + +-static struct sysfs_ops bus_sysfs_ops = { ++static const struct sysfs_ops bus_sysfs_ops = { + .show = bus_attr_show, + .store = bus_attr_store, + }; +--- a/drivers/base/class.c ++++ b/drivers/base/class.c +@@ -61,7 +61,7 @@ static void class_release(struct kobject + "be careful\n", class->name); + } + +-static struct sysfs_ops class_sysfs_ops = { ++static const struct sysfs_ops class_sysfs_ops = { + .show = class_attr_show, + .store = class_attr_store, + }; +--- a/drivers/base/core.c ++++ b/drivers/base/core.c +@@ -100,7 +100,7 @@ static ssize_t dev_attr_store(struct kob + return ret; + } + +-static struct sysfs_ops dev_sysfs_ops = { ++static const struct sysfs_ops dev_sysfs_ops = { + .show = dev_attr_show, + .store = dev_attr_store, + }; +--- a/drivers/base/sys.c ++++ b/drivers/base/sys.c +@@ -54,7 +54,7 @@ sysdev_store(struct kobject *kobj, struc + return -EIO; + } + +-static struct sysfs_ops sysfs_ops = { ++static const struct sysfs_ops sysfs_ops = { + .show = sysdev_show, + .store = sysdev_store, + }; +@@ -104,7 +104,7 @@ static ssize_t sysdev_class_store(struct + return -EIO; + } + +-static struct sysfs_ops sysfs_class_ops = { ++static const struct sysfs_ops sysfs_class_ops = { + .show = sysdev_class_show, + .store = sysdev_class_store, + }; +--- a/drivers/block/pktcdvd.c ++++ b/drivers/block/pktcdvd.c +@@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kob + return len; + } + +-static struct sysfs_ops kobj_pkt_ops = { ++static const struct sysfs_ops kobj_pkt_ops = { + .show = kobj_pkt_show, + .store = kobj_pkt_store + }; +--- a/drivers/cpufreq/cpufreq.c ++++ b/drivers/cpufreq/cpufreq.c +@@ -766,7 +766,7 @@ static void cpufreq_sysfs_release(struct + complete(&policy->kobj_unregister); + } + +-static struct sysfs_ops sysfs_ops = { ++static const struct sysfs_ops sysfs_ops = { + .show = show, + .store = store, + }; +--- a/drivers/cpuidle/sysfs.c ++++ b/drivers/cpuidle/sysfs.c +@@ -195,7 +195,7 @@ static ssize_t cpuidle_store(struct kobj + return ret; + } + +-static struct sysfs_ops cpuidle_sysfs_ops = { ++static const struct sysfs_ops cpuidle_sysfs_ops = { + .show = cpuidle_show, + .store = cpuidle_store, + }; +@@ -281,7 +281,7 @@ static ssize_t cpuidle_state_show(struct + return ret; + } + +-static struct sysfs_ops cpuidle_state_sysfs_ops = { ++static const struct sysfs_ops cpuidle_state_sysfs_ops = { + .show = cpuidle_state_show, + }; + +--- a/drivers/dma/ioat/dma.c ++++ b/drivers/dma/ioat/dma.c +@@ -1146,7 +1146,7 @@ ioat_attr_show(struct kobject *kobj, str + return entry->show(&chan->common, page); + } + +-struct sysfs_ops ioat_sysfs_ops = { ++const struct sysfs_ops ioat_sysfs_ops = { + .show = ioat_attr_show, + }; + +--- a/drivers/dma/ioat/dma.h ++++ b/drivers/dma/ioat/dma.h +@@ -347,7 +347,7 @@ bool ioat_cleanup_preamble(struct ioat_c + unsigned long *phys_complete); + void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type); + void ioat_kobject_del(struct ioatdma_device *device); +-extern struct sysfs_ops ioat_sysfs_ops; ++extern const struct sysfs_ops ioat_sysfs_ops; + extern struct ioat_sysfs_entry ioat_version_attr; + extern struct ioat_sysfs_entry ioat_cap_attr; + #endif /* IOATDMA_H */ +--- a/drivers/edac/edac_device_sysfs.c ++++ b/drivers/edac/edac_device_sysfs.c +@@ -137,7 +137,7 @@ static ssize_t edac_dev_ctl_info_store(s + } + + /* edac_dev file operations for an 'ctl_info' */ +-static struct sysfs_ops device_ctl_info_ops = { ++static const struct sysfs_ops device_ctl_info_ops = { + .show = edac_dev_ctl_info_show, + .store = edac_dev_ctl_info_store + }; +@@ -373,7 +373,7 @@ static ssize_t edac_dev_instance_store(s + } + + /* edac_dev file operations for an 'instance' */ +-static struct sysfs_ops device_instance_ops = { ++static const struct sysfs_ops device_instance_ops = { + .show = edac_dev_instance_show, + .store = edac_dev_instance_store + }; +@@ -476,7 +476,7 @@ static ssize_t edac_dev_block_store(stru + } + + /* edac_dev file operations for a 'block' */ +-static struct sysfs_ops device_block_ops = { ++static const struct sysfs_ops device_block_ops = { + .show = edac_dev_block_show, + .store = edac_dev_block_store + }; +--- a/drivers/edac/edac_mc_sysfs.c ++++ b/drivers/edac/edac_mc_sysfs.c +@@ -245,7 +245,7 @@ static ssize_t csrowdev_store(struct kob + return -EIO; + } + +-static struct sysfs_ops csrowfs_ops = { ++static const struct sysfs_ops csrowfs_ops = { + .show = csrowdev_show, + .store = csrowdev_store + }; +@@ -575,7 +575,7 @@ static ssize_t mcidev_store(struct kobje + } + + /* Intermediate show/store table */ +-static struct sysfs_ops mci_ops = { ++static const struct sysfs_ops mci_ops = { + .show = mcidev_show, + .store = mcidev_store + }; +--- a/drivers/edac/edac_pci_sysfs.c ++++ b/drivers/edac/edac_pci_sysfs.c +@@ -121,7 +121,7 @@ static ssize_t edac_pci_instance_store(s + } + + /* fs_ops table */ +-static struct sysfs_ops pci_instance_ops = { ++static const struct sysfs_ops pci_instance_ops = { + .show = edac_pci_instance_show, + .store = edac_pci_instance_store + }; +@@ -261,7 +261,7 @@ static ssize_t edac_pci_dev_store(struct + return -EIO; + } + +-static struct sysfs_ops edac_pci_sysfs_ops = { ++static const struct sysfs_ops edac_pci_sysfs_ops = { + .show = edac_pci_dev_show, + .store = edac_pci_dev_store + }; +--- a/drivers/firmware/edd.c ++++ b/drivers/firmware/edd.c +@@ -122,7 +122,7 @@ edd_attr_show(struct kobject * kobj, str + return ret; + } + +-static struct sysfs_ops edd_attr_ops = { ++static const struct sysfs_ops edd_attr_ops = { + .show = edd_attr_show, + }; + +--- a/drivers/firmware/efivars.c ++++ b/drivers/firmware/efivars.c +@@ -362,7 +362,7 @@ static ssize_t efivar_attr_store(struct + return ret; + } + +-static struct sysfs_ops efivar_attr_ops = { ++static const struct sysfs_ops efivar_attr_ops = { + .show = efivar_attr_show, + .store = efivar_attr_store, + }; +--- a/drivers/firmware/iscsi_ibft.c ++++ b/drivers/firmware/iscsi_ibft.c +@@ -525,7 +525,7 @@ static ssize_t ibft_show_attribute(struc + return ret; + } + +-static struct sysfs_ops ibft_attr_ops = { ++static const struct sysfs_ops ibft_attr_ops = { + .show = ibft_show_attribute, + }; + +--- a/drivers/firmware/memmap.c ++++ b/drivers/firmware/memmap.c +@@ -74,7 +74,7 @@ static struct attribute *def_attrs[] = { + NULL + }; + +-static struct sysfs_ops memmap_attr_ops = { ++static const struct sysfs_ops memmap_attr_ops = { + .show = memmap_attr_show, + }; + +--- a/drivers/gpu/drm/ttm/ttm_bo.c ++++ b/drivers/gpu/drm/ttm/ttm_bo.c +@@ -128,7 +128,7 @@ static struct attribute *ttm_bo_global_a + NULL + }; + +-static struct sysfs_ops ttm_bo_global_ops = { ++static const struct sysfs_ops ttm_bo_global_ops = { + .show = &ttm_bo_global_show + }; + +--- a/drivers/gpu/drm/ttm/ttm_memory.c ++++ b/drivers/gpu/drm/ttm/ttm_memory.c +@@ -152,7 +152,7 @@ static struct attribute *ttm_mem_zone_at + NULL + }; + +-static struct sysfs_ops ttm_mem_zone_ops = { ++static const struct sysfs_ops ttm_mem_zone_ops = { + .show = &ttm_mem_zone_show, + .store = &ttm_mem_zone_store + }; +--- a/drivers/infiniband/core/cm.c ++++ b/drivers/infiniband/core/cm.c +@@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct ko + atomic_long_read(&group->counter[cm_attr->index])); + } + +-static struct sysfs_ops cm_counter_ops = { ++static const struct sysfs_ops cm_counter_ops = { + .show = cm_show_counter + }; + +--- a/drivers/infiniband/core/sysfs.c ++++ b/drivers/infiniband/core/sysfs.c +@@ -79,7 +79,7 @@ static ssize_t port_attr_show(struct kob + return port_attr->show(p, port_attr, buf); + } + +-static struct sysfs_ops port_sysfs_ops = { ++static const struct sysfs_ops port_sysfs_ops = { + .show = port_attr_show + }; + +--- a/drivers/md/dm-sysfs.c ++++ b/drivers/md/dm-sysfs.c +@@ -75,7 +75,7 @@ static struct attribute *dm_attrs[] = { + NULL, + }; + +-static struct sysfs_ops dm_sysfs_ops = { ++static const struct sysfs_ops dm_sysfs_ops = { + .show = dm_attr_show, + }; + +--- a/drivers/md/md.c ++++ b/drivers/md/md.c +@@ -2642,7 +2642,7 @@ static void rdev_free(struct kobject *ko + mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj); + kfree(rdev); + } +-static struct sysfs_ops rdev_sysfs_ops = { ++static const struct sysfs_ops rdev_sysfs_ops = { + .show = rdev_attr_show, + .store = rdev_attr_store, + }; +@@ -4059,7 +4059,7 @@ static void md_free(struct kobject *ko) + kfree(mddev); + } + +-static struct sysfs_ops md_sysfs_ops = { ++static const struct sysfs_ops md_sysfs_ops = { + .show = md_attr_show, + .store = md_attr_store, + }; +--- a/drivers/net/ibmveth.c ++++ b/drivers/net/ibmveth.c +@@ -1577,7 +1577,7 @@ static struct attribute * veth_pool_attr + NULL, + }; + +-static struct sysfs_ops veth_pool_ops = { ++static const struct sysfs_ops veth_pool_ops = { + .show = veth_pool_show, + .store = veth_pool_store, + }; +--- a/drivers/net/iseries_veth.c ++++ b/drivers/net/iseries_veth.c +@@ -384,7 +384,7 @@ static struct attribute *veth_cnx_defaul + NULL + }; + +-static struct sysfs_ops veth_cnx_sysfs_ops = { ++static const struct sysfs_ops veth_cnx_sysfs_ops = { + .show = veth_cnx_attribute_show + }; + +@@ -441,7 +441,7 @@ static struct attribute *veth_port_defau + NULL + }; + +-static struct sysfs_ops veth_port_sysfs_ops = { ++static const struct sysfs_ops veth_port_sysfs_ops = { + .show = veth_port_attribute_show + }; + +--- a/drivers/parisc/pdc_stable.c ++++ b/drivers/parisc/pdc_stable.c +@@ -481,7 +481,7 @@ pdcspath_attr_store(struct kobject *kobj + return ret; + } + +-static struct sysfs_ops pdcspath_attr_ops = { ++static const struct sysfs_ops pdcspath_attr_ops = { + .show = pdcspath_attr_show, + .store = pdcspath_attr_store, + }; +--- a/drivers/pci/hotplug/fakephp.c ++++ b/drivers/pci/hotplug/fakephp.c +@@ -73,7 +73,7 @@ static void legacy_release(struct kobjec + } + + static struct kobj_type legacy_ktype = { +- .sysfs_ops = &(struct sysfs_ops){ ++ .sysfs_ops = &(const struct sysfs_ops){ + .store = legacy_store, .show = legacy_show + }, + .release = &legacy_release, +--- a/drivers/pci/slot.c ++++ b/drivers/pci/slot.c +@@ -29,7 +29,7 @@ static ssize_t pci_slot_attr_store(struc + return attribute->store ? attribute->store(slot, buf, len) : -EIO; + } + +-static struct sysfs_ops pci_slot_sysfs_ops = { ++static const struct sysfs_ops pci_slot_sysfs_ops = { + .show = pci_slot_attr_show, + .store = pci_slot_attr_store, + }; +--- a/drivers/uio/uio.c ++++ b/drivers/uio/uio.c +@@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobj + return entry->show(mem, buf); + } + +-static struct sysfs_ops map_sysfs_ops = { ++static const struct sysfs_ops map_sysfs_ops = { + .show = map_type_show, + }; + +@@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct k + return entry->show(port, buf); + } + +-static struct sysfs_ops portio_sysfs_ops = { ++static const struct sysfs_ops portio_sysfs_ops = { + .show = portio_type_show, + }; + +--- a/drivers/uwb/wlp/sysfs.c ++++ b/drivers/uwb/wlp/sysfs.c +@@ -615,8 +615,7 @@ ssize_t wlp_wss_attr_store(struct kobjec + return ret; + } + +-static +-struct sysfs_ops wss_sysfs_ops = { ++static const struct sysfs_ops wss_sysfs_ops = { + .show = wlp_wss_attr_show, + .store = wlp_wss_attr_store, + }; +--- a/drivers/video/omap2/dss/manager.c ++++ b/drivers/video/omap2/dss/manager.c +@@ -341,7 +341,7 @@ static ssize_t manager_attr_store(struct + return manager_attr->store(manager, buf, size); + } + +-static struct sysfs_ops manager_sysfs_ops = { ++static const struct sysfs_ops manager_sysfs_ops = { + .show = manager_attr_show, + .store = manager_attr_store, + }; +--- a/drivers/video/omap2/dss/overlay.c ++++ b/drivers/video/omap2/dss/overlay.c +@@ -320,7 +320,7 @@ static ssize_t overlay_attr_store(struct + return overlay_attr->store(overlay, buf, size); + } + +-static struct sysfs_ops overlay_sysfs_ops = { ++static const struct sysfs_ops overlay_sysfs_ops = { + .show = overlay_attr_show, + .store = overlay_attr_store, + }; +--- a/drivers/xen/sys-hypervisor.c ++++ b/drivers/xen/sys-hypervisor.c +@@ -426,7 +426,7 @@ static ssize_t hyp_sysfs_store(struct ko + return 0; + } + +-static struct sysfs_ops hyp_sysfs_ops = { ++static const struct sysfs_ops hyp_sysfs_ops = { + .show = hyp_sysfs_show, + .store = hyp_sysfs_store, + }; +--- a/fs/btrfs/sysfs.c ++++ b/fs/btrfs/sysfs.c +@@ -164,12 +164,12 @@ static void btrfs_root_release(struct ko + complete(&root->kobj_unregister); + } + +-static struct sysfs_ops btrfs_super_attr_ops = { ++static const struct sysfs_ops btrfs_super_attr_ops = { + .show = btrfs_super_attr_show, + .store = btrfs_super_attr_store, + }; + +-static struct sysfs_ops btrfs_root_attr_ops = { ++static const struct sysfs_ops btrfs_root_attr_ops = { + .show = btrfs_root_attr_show, + .store = btrfs_root_attr_store, + }; +--- a/fs/dlm/lockspace.c ++++ b/fs/dlm/lockspace.c +@@ -148,7 +148,7 @@ static void lockspace_kobj_release(struc + kfree(ls); + } + +-static struct sysfs_ops dlm_attr_ops = { ++static const struct sysfs_ops dlm_attr_ops = { + .show = dlm_attr_show, + .store = dlm_attr_store, + }; +--- a/fs/ext4/super.c ++++ b/fs/ext4/super.c +@@ -2292,7 +2292,7 @@ static void ext4_sb_release(struct kobje + } + + +-static struct sysfs_ops ext4_attr_ops = { ++static const struct sysfs_ops ext4_attr_ops = { + .show = ext4_attr_show, + .store = ext4_attr_store, + }; +--- a/fs/gfs2/sys.c ++++ b/fs/gfs2/sys.c +@@ -49,7 +49,7 @@ static ssize_t gfs2_attr_store(struct ko + return a->store ? a->store(sdp, buf, len) : len; + } + +-static struct sysfs_ops gfs2_attr_ops = { ++static const struct sysfs_ops gfs2_attr_ops = { + .show = gfs2_attr_show, + .store = gfs2_attr_store, + }; +--- a/fs/ocfs2/cluster/masklog.c ++++ b/fs/ocfs2/cluster/masklog.c +@@ -135,7 +135,7 @@ static ssize_t mlog_store(struct kobject + return mlog_mask_store(mlog_attr->mask, buf, count); + } + +-static struct sysfs_ops mlog_attr_ops = { ++static const struct sysfs_ops mlog_attr_ops = { + .show = mlog_show, + .store = mlog_store, + }; +--- a/fs/sysfs/file.c ++++ b/fs/sysfs/file.c +@@ -53,7 +53,7 @@ struct sysfs_buffer { + size_t count; + loff_t pos; + char * page; +- struct sysfs_ops * ops; ++ const struct sysfs_ops * ops; + struct mutex mutex; + int needs_read_fill; + int event; +@@ -75,7 +75,7 @@ static int fill_read_buffer(struct dentr + { + struct sysfs_dirent *attr_sd = dentry->d_fsdata; + struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; +- struct sysfs_ops * ops = buffer->ops; ++ const struct sysfs_ops * ops = buffer->ops; + int ret = 0; + ssize_t count; + +@@ -199,7 +199,7 @@ flush_write_buffer(struct dentry * dentr + { + struct sysfs_dirent *attr_sd = dentry->d_fsdata; + struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; +- struct sysfs_ops * ops = buffer->ops; ++ const struct sysfs_ops * ops = buffer->ops; + int rc; + + /* need attr_sd for attr and ops, its parent for kobj */ +@@ -335,7 +335,7 @@ static int sysfs_open_file(struct inode + struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata; + struct kobject *kobj = attr_sd->s_parent->s_dir.kobj; + struct sysfs_buffer *buffer; +- struct sysfs_ops *ops; ++ const struct sysfs_ops *ops; + int error = -EACCES; + char *p; + +--- a/include/linux/kobject.h ++++ b/include/linux/kobject.h +@@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kob + + struct kobj_type { + void (*release)(struct kobject *kobj); +- struct sysfs_ops *sysfs_ops; ++ const struct sysfs_ops *sysfs_ops; + struct attribute **default_attrs; + }; + +@@ -132,7 +132,7 @@ struct kobj_attribute { + const char *buf, size_t count); + }; + +-extern struct sysfs_ops kobj_sysfs_ops; ++extern const struct sysfs_ops kobj_sysfs_ops; + + /** + * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. +--- a/kernel/params.c ++++ b/kernel/params.c +@@ -723,7 +723,7 @@ static ssize_t module_attr_store(struct + return ret; + } + +-static struct sysfs_ops module_sysfs_ops = { ++static const struct sysfs_ops module_sysfs_ops = { + .show = module_attr_show, + .store = module_attr_store, + }; +--- a/lib/kobject.c ++++ b/lib/kobject.c +@@ -700,7 +700,7 @@ static ssize_t kobj_attr_store(struct ko + return ret; + } + +-struct sysfs_ops kobj_sysfs_ops = { ++const struct sysfs_ops kobj_sysfs_ops = { + .show = kobj_attr_show, + .store = kobj_attr_store, + }; +--- a/mm/slub.c ++++ b/mm/slub.c +@@ -4519,7 +4519,7 @@ static void kmem_cache_release(struct ko + kfree(s); + } + +-static struct sysfs_ops slab_sysfs_ops = { ++static const struct sysfs_ops slab_sysfs_ops = { + .show = slab_attr_show, + .store = slab_attr_store, + }; +--- a/net/bridge/br_private.h ++++ b/net/bridge/br_private.h +@@ -254,7 +254,7 @@ extern void br_ifinfo_notify(int event, + + #ifdef CONFIG_SYSFS + /* br_sysfs_if.c */ +-extern struct sysfs_ops brport_sysfs_ops; ++extern const struct sysfs_ops brport_sysfs_ops; + extern int br_sysfs_addif(struct net_bridge_port *p); + + /* br_sysfs_br.c */ +--- a/net/bridge/br_sysfs_if.c ++++ b/net/bridge/br_sysfs_if.c +@@ -220,7 +220,7 @@ static ssize_t brport_store(struct kobje + return ret; + } + +-struct sysfs_ops brport_sysfs_ops = { ++const struct sysfs_ops brport_sysfs_ops = { + .show = brport_show, + .store = brport_store, + }; +--- a/samples/kobject/kset-example.c ++++ b/samples/kobject/kset-example.c +@@ -87,7 +87,7 @@ static ssize_t foo_attr_store(struct kob + } + + /* Our custom sysfs_ops that we will associate with our ktype later on */ +-static struct sysfs_ops foo_sysfs_ops = { ++static const struct sysfs_ops foo_sysfs_ops = { + .show = foo_attr_show, + .store = foo_attr_store, + }; @@ -25,6 +25,10 @@ usb.current/usb-s3c-hsotg-export-usb_gadget_register_driver.patch usb.current/usb-ehci-phy-low-power-mode-bug-fixing.patch usb.current/usb-sis-usb2vga-driver-support-kairen-s-usb-vga-adaptor-usb20svga-mb-plus.patch usb.current/usb-serial-add-usbid-for-dell-wwan-card-to-sierra.c.patch +usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch +usb.current/usb-fhci-fix-build-after-kfifo-rework.patch +usb.current/kfifo-don-t-use-integer-as-null-pointer.patch + ################################# @@ -64,6 +68,7 @@ driver-core/driver-core-firmware_class-remove-base.h-header-inclusion.patch driver-core/kobject-constify-struct-kset_uevent_ops.patch driver-core/howto-updates-on-subsystem-trees-patchwork-next-vs.-mm.patch driver-core/sysdev-fix-up-the-probe-release-attributes.patch +driver-core/driver-core-constify-struct-sysfs_ops-in-struct-kobj_type.patch # sent to Lennart 01-15-2010 driver-core/msi-laptop-support-standard-ec-66-62-command-on-msi-notebook-and-nebook.patch @@ -455,5 +460,40 @@ staging/staging-rt2870sta-constify-rtusbmultiwrite-rtusbfirmwarewrite.patch staging/staging-rt-2860-2870-sta-use-request_firmware-to-load-firmware.patch staging/staging-rtl8187se-fix-if-statement.patch staging/staging-crystalhd-fix-build-on-powerpc.patch +staging/staging-et131x-kill-off-the-fbr_num_des-type.patch +staging/staging-et131x-kill-of-fbr_word2.patch +staging/staging-et131x-fbr_desc-is-now-only-sane-types.patch +staging/staging-et131x-clean-up-rxdma_csr.patch +staging/staging-et131x-kill-off-the-rxdma-type.patch +staging/staging-et131x-kill-exp_rom.patch +staging/staging-et131x-global_t-is-now-sane-so-kill-the-global_t-itself.patch +staging/staging-et131x-kill-off-txdma_t.patch +staging/staging-et131x-kill-off-mmc_t.patch +staging/staging-et131x-kill-mac_stat_t.patch +staging/staging-et131x-clean-up-the-rx-status-word-types.patch +staging/staging-et131x-kill-off-the-rx-interrupt-state-enum.patch +staging/staging-et131x-rx_status_block_t-is-now-clean.patch +staging/staging-et131x-fix-rx_status-typing.patch +staging/staging-et131x-clean-up-the-fbr-lookup-table.patch +staging/staging-et131x-clean-up-the-pkt_desc_stat_t-types.patch +staging/staging-et131x-kill-off-rx_ring_t.patch +staging/staging-et131x-kill-mp_err_counters-which-is-unused.patch +staging/staging-et131x-kill-unused-error-defines.patch +staging/staging-et131x-collapse-all-the-function-definitions-into-one-place.patch +staging/staging-et131x-kil-the-txmac-type.patch +staging/staging-et131x-kill-txmac-err-count-typedef.patch +staging/staging-et131x-kill-off-the-txmac_err_t-type.patch +staging/staging-et13x-kill-off-txmac_err_int_t.patch +staging/staging-et131x-kill-rxmac-crc-fields.patch +staging/staging-et131x-kill-off-rxmac_pf_ctrl_t.patch +staging/staging-et131x-kill-of-the-mcif-types.patch +staging/staging-et131x-kill-off-the-rxq_diag-types.patch +staging/staging-et131x-kill-the-space_avail-type.patch +staging/staging-et131x-kill-mif_ctl_t.patch +staging/staging-et131x-kill-the-rxmac-error_reg_t.patch +staging/staging-et131x-kill-off-the-rxmac-ctrl-type.patch +staging/staging-et131x_kill-mac_stat_t.patch +staging/staging-hv-remove-xen-legacy-code-and-check-for-hyper-v.patch + diff --git a/staging/staging-et131x-clean-up-rxdma_csr.patch b/staging/staging-et131x-clean-up-rxdma_csr.patch new file mode 100644 index 00000000000000..7e60c8864a54ab --- /dev/null +++ b/staging/staging-et131x-clean-up-rxdma_csr.patch @@ -0,0 +1,171 @@ +From alan@linux.intel.com Wed Jan 27 15:38:50 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:32:55 +0000 +Subject: Staging: et131x: Clean up rxdma_csr +To: greg@kroah.com +Message-ID: <20100118153255.6884.92831.stgit@localhost.localdomain> + + +This is another set of flags as typedef that can be cleaned up. + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 58 +++++++++------------------- + drivers/staging/et131x/et1310_rx.c | 46 ++++++++++------------ + 2 files changed, 41 insertions(+), 63 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -292,45 +292,25 @@ typedef struct _TXDMA_t { /* Location: + /* + * structure for control status reg in rxdma address map + * Located at address 0x2000 ++ * ++ * CSR ++ * 0: halt ++ * 1-3: tc ++ * 4: fbr_big_endian ++ * 5: psr_big_endian ++ * 6: pkt_big_endian ++ * 7: dma_big_endian ++ * 8-9: fbr0_size ++ * 10: fbr0_enable ++ * 11-12: fbr1_size ++ * 13: fbr1_enable ++ * 14: unused ++ * 15: pkt_drop_disable ++ * 16: pkt_done_flush ++ * 17: halt_status ++ * 18-31: unused + */ +-typedef union _RXDMA_CSR_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused2:14; /* bits 18-31 */ +- u32 halt_status:1; /* bit 17 */ +- u32 pkt_done_flush:1; /* bit 16 */ +- u32 pkt_drop_disable:1; /* bit 15 */ +- u32 unused1:1; /* bit 14 */ +- u32 fbr1_enable:1; /* bit 13 */ +- u32 fbr1_size:2; /* bits 11-12 */ +- u32 fbr0_enable:1; /* bit 10 */ +- u32 fbr0_size:2; /* bits 8-9 */ +- u32 dma_big_endian:1; /* bit 7 */ +- u32 pkt_big_endian:1; /* bit 6 */ +- u32 psr_big_endian:1; /* bit 5 */ +- u32 fbr_big_endian:1; /* bit 4 */ +- u32 tc:3; /* bits 1-3 */ +- u32 halt:1; /* bit 0 */ +-#else +- u32 halt:1; /* bit 0 */ +- u32 tc:3; /* bits 1-3 */ +- u32 fbr_big_endian:1; /* bit 4 */ +- u32 psr_big_endian:1; /* bit 5 */ +- u32 pkt_big_endian:1; /* bit 6 */ +- u32 dma_big_endian:1; /* bit 7 */ +- u32 fbr0_size:2; /* bits 8-9 */ +- u32 fbr0_enable:1; /* bit 10 */ +- u32 fbr1_size:2; /* bits 11-12 */ +- u32 fbr1_enable:1; /* bit 13 */ +- u32 unused1:1; /* bit 14 */ +- u32 pkt_drop_disable:1; /* bit 15 */ +- u32 pkt_done_flush:1; /* bit 16 */ +- u32 halt_status:1; /* bit 17 */ +- u32 unused2:14; /* bits 18-31 */ +-#endif +- } bits; +-} RXDMA_CSR_t, *PRXDMA_CSR_t; ++ + + /* + * structure for dma writeback lo reg in rxdma address map +@@ -521,7 +501,7 @@ typedef union _RXDMA_CSR_t { + * Located at address 0x2000 + */ + typedef struct _RXDMA_t { /* Location: */ +- RXDMA_CSR_t csr; /* 0x2000 */ ++ u32 csr; /* 0x2000 */ + u32 dma_wb_base_lo; /* 0x2004 */ + u32 dma_wb_base_hi; /* 0x2008 */ + u32 num_pkt_done; /* 0x200C */ +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -720,18 +720,17 @@ void SetRxDmaTimer(struct et131x_adapter + */ + void et131x_rx_dma_disable(struct et131x_adapter *etdev) + { +- RXDMA_CSR_t csr; +- ++ u32 csr; + /* Setup the receive dma configuration register */ +- writel(0x00002001, &etdev->regs->rxdma.csr.value); +- csr.value = readl(&etdev->regs->rxdma.csr.value); +- if (csr.bits.halt_status != 1) { ++ writel(0x00002001, &etdev->regs->rxdma.csr); ++ csr = readl(&etdev->regs->rxdma.csr); ++ if ((csr & 0x00020000) != 1) { /* Check halt status (bit 17) */ + udelay(5); +- csr.value = readl(&etdev->regs->rxdma.csr.value); +- if (csr.bits.halt_status != 1) ++ csr = readl(&etdev->regs->rxdma.csr); ++ if ((csr & 0x00020000) != 1) + dev_err(&etdev->pdev->dev, +- "RX Dma failed to enter halt state. CSR 0x%08x\n", +- csr.value); ++ "RX Dma failed to enter halt state. CSR 0x%08x\n", ++ csr); + } + } + +@@ -742,34 +741,33 @@ void et131x_rx_dma_disable(struct et131x + void et131x_rx_dma_enable(struct et131x_adapter *etdev) + { + /* Setup the receive dma configuration register for normal operation */ +- RXDMA_CSR_t csr = { 0 }; ++ u32 csr = 0x2000; /* FBR1 enable */ + +- csr.bits.fbr1_enable = 1; + if (etdev->RxRing.Fbr1BufferSize == 4096) +- csr.bits.fbr1_size = 1; ++ csr |= 0x0800; + else if (etdev->RxRing.Fbr1BufferSize == 8192) +- csr.bits.fbr1_size = 2; ++ csr |= 0x1000; + else if (etdev->RxRing.Fbr1BufferSize == 16384) +- csr.bits.fbr1_size = 3; ++ csr |= 0x1800; + #ifdef USE_FBR0 +- csr.bits.fbr0_enable = 1; ++ csr |= 0x0400; /* FBR0 enable */ + if (etdev->RxRing.Fbr0BufferSize == 256) +- csr.bits.fbr0_size = 1; ++ csr |= 0x0100; + else if (etdev->RxRing.Fbr0BufferSize == 512) +- csr.bits.fbr0_size = 2; ++ csr |= 0x0200; + else if (etdev->RxRing.Fbr0BufferSize == 1024) +- csr.bits.fbr0_size = 3; ++ csr |= 0x0300; + #endif +- writel(csr.value, &etdev->regs->rxdma.csr.value); ++ writel(csr, &etdev->regs->rxdma.csr); + +- csr.value = readl(&etdev->regs->rxdma.csr.value); +- if (csr.bits.halt_status != 0) { ++ csr = readl(&etdev->regs->rxdma.csr); ++ if ((csr & 0x00020000) != 0) { + udelay(5); +- csr.value = readl(&etdev->regs->rxdma.csr.value); +- if (csr.bits.halt_status != 0) { ++ csr = readl(&etdev->regs->rxdma.csr); ++ if ((csr & 0x00020000) != 0) { + dev_err(&etdev->pdev->dev, + "RX Dma failed to exit halt state. CSR 0x%08x\n", +- csr.value); ++ csr); + } + } + } diff --git a/staging/staging-et131x-clean-up-the-fbr-lookup-table.patch b/staging/staging-et131x-clean-up-the-fbr-lookup-table.patch new file mode 100644 index 00000000000000..2621eb7fedfd3c --- /dev/null +++ b/staging/staging-et131x-clean-up-the-fbr-lookup-table.patch @@ -0,0 +1,223 @@ +From alan@linux.intel.com Wed Jan 27 15:43:38 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:56 +0000 +Subject: Staging: et131x: Clean up the fbr lookup table +To: greg@kroah.com +Message-ID: <20100118153356.6884.4457.stgit@localhost.localdomain> + + +All the subtypes are sane so just turn it into something struct and linux +like + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 65 ++++++++++++++++++------------------- + drivers/staging/et131x/et1310_rx.h | 16 ++++----- + 2 files changed, 40 insertions(+), 41 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -116,10 +116,9 @@ int et131x_rx_dma_memory_alloc(struct et + + /* Alloc memory for the lookup table */ + #ifdef USE_FBR0 +- rx_ring->Fbr[0] = kmalloc(sizeof(FBRLOOKUPTABLE), GFP_KERNEL); ++ rx_ring->fbr[0] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL); + #endif +- +- rx_ring->Fbr[1] = kmalloc(sizeof(FBRLOOKUPTABLE), GFP_KERNEL); ++ rx_ring->fbr[1] = kmalloc(sizeof(struct fbr_lookup), GFP_KERNEL); + + /* The first thing we will do is configure the sizes of the buffer + * rings. These will change based on jumbo packet support. Larger +@@ -270,23 +269,23 @@ int et131x_rx_dma_memory_alloc(struct et + /* Save the Virtual address of this index for quick + * access later + */ +- rx_ring->Fbr[1]->Va[index] = ++ rx_ring->fbr[1]->virt[index] = + (uint8_t *) rx_ring->Fbr1MemVa[i] + + (j * rx_ring->Fbr1BufferSize) + Fbr1Offset; + + /* now store the physical address in the descriptor + * so the device can access it + */ +- rx_ring->Fbr[1]->PAHigh[index] = ++ rx_ring->fbr[1]->bus_high[index] = + (u32) (Fbr1TempPa >> 32); +- rx_ring->Fbr[1]->PALow[index] = (u32) Fbr1TempPa; ++ rx_ring->fbr[1]->bus_low[index] = (u32) Fbr1TempPa; + + Fbr1TempPa += rx_ring->Fbr1BufferSize; + +- rx_ring->Fbr[1]->Buffer1[index] = +- rx_ring->Fbr[1]->Va[index]; +- rx_ring->Fbr[1]->Buffer2[index] = +- rx_ring->Fbr[1]->Va[index] - 4; ++ rx_ring->fbr[1]->buffer1[index] = ++ rx_ring->fbr[1]->virt[index]; ++ rx_ring->fbr[1]->buffer2[index] = ++ rx_ring->fbr[1]->virt[index] - 4; + } + } + +@@ -319,20 +318,20 @@ int et131x_rx_dma_memory_alloc(struct et + for (j = 0; j < FBR_CHUNKS; j++) { + u32 index = (i * FBR_CHUNKS) + j; + +- rx_ring->Fbr[0]->Va[index] = ++ rx_ring->fbr[0]->virt[index] = + (uint8_t *) rx_ring->Fbr0MemVa[i] + + (j * rx_ring->Fbr0BufferSize) + Fbr0Offset; + +- rx_ring->Fbr[0]->PAHigh[index] = ++ rx_ring->fbr[0]->bus_high[index] = + (u32) (Fbr0TempPa >> 32); +- rx_ring->Fbr[0]->PALow[index] = (u32) Fbr0TempPa; ++ rx_ring->fbr[0]->bus_low[index] = (u32) Fbr0TempPa; + + Fbr0TempPa += rx_ring->Fbr0BufferSize; + +- rx_ring->Fbr[0]->Buffer1[index] = +- rx_ring->Fbr[0]->Va[index]; +- rx_ring->Fbr[0]->Buffer2[index] = +- rx_ring->Fbr[0]->Va[index] - 4; ++ rx_ring->fbr[0]->buffer1[index] = ++ rx_ring->fbr[0]->virt[index]; ++ rx_ring->fbr[0]->buffer2[index] = ++ rx_ring->fbr[0]->virt[index] - 4; + } + } + #endif +@@ -525,10 +524,10 @@ void et131x_rx_dma_memory_free(struct et + + /* Free the FBR Lookup Table */ + #ifdef USE_FBR0 +- kfree(rx_ring->Fbr[0]); ++ kfree(rx_ring->fbr[0]); + #endif + +- kfree(rx_ring->Fbr[1]); ++ kfree(rx_ring->fbr[1]); + + /* Reset Counters */ + rx_ring->nReadyRecv = 0; +@@ -609,9 +608,9 @@ void ConfigRxDmaRegs(struct et131x_adapt + * are ever returned, make sure the high part is retrieved here + * before storing the adjusted address. + */ +- writel((u32) ((u64)rx_local->pRxStatusPa >> 32), ++ writel((u32) ((u64)rx_local->rx_status_bus >> 32), + &rx_dma->dma_wb_base_hi); +- writel((u32) rx_local->pRxStatusPa, &rx_dma->dma_wb_base_lo); ++ writel((u32) rx_local->rx_status_bus, &rx_dma->dma_wb_base_lo); + + memset(rx_local->rx_status_block, 0, sizeof(struct rx_status_block)); + +@@ -636,8 +635,8 @@ void ConfigRxDmaRegs(struct et131x_adapt + /* Now's the best time to initialize FBR1 contents */ + fbr_entry = (struct fbr_desc *) rx_local->pFbr1RingVa; + for (entry = 0; entry < rx_local->Fbr1NumEntries; entry++) { +- fbr_entry->addr_hi = rx_local->Fbr[1]->PAHigh[entry]; +- fbr_entry->addr_lo = rx_local->Fbr[1]->PALow[entry]; ++ fbr_entry->addr_hi = rx_local->fbr[1]->bus_high[entry]; ++ fbr_entry->addr_lo = rx_local->fbr[1]->bus_low[entry]; + fbr_entry->word2 = entry; + fbr_entry++; + } +@@ -661,8 +660,8 @@ void ConfigRxDmaRegs(struct et131x_adapt + /* Now's the best time to initialize FBR0 contents */ + fbr_entry = (struct fbr_desc *) rx_local->pFbr0RingVa; + for (entry = 0; entry < rx_local->Fbr0NumEntries; entry++) { +- fbr_entry->addr_hi = rx_local->Fbr[0]->PAHigh[entry]; +- fbr_entry->addr_lo = rx_local->Fbr[0]->PALow[entry]; ++ fbr_entry->addr_hi = rx_local->fbr[0]->bus_high[entry]; ++ fbr_entry->addr_lo = rx_local->fbr[0]->bus_low[entry]; + fbr_entry->word2 = entry; + fbr_entry++; + } +@@ -893,7 +892,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + + if (len) { + if (etdev->ReplicaPhyLoopbk == 1) { +- buf = rx_local->Fbr[rindex]->Va[bindex]; ++ buf = rx_local->fbr[rindex]->virt[bindex]; + + if (memcmp(&buf[6], &etdev->CurrentAddress[0], + ETH_ALEN) == 0) { +@@ -917,8 +916,8 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + if ((etdev->PacketFilter & ET131X_PACKET_TYPE_MULTICAST) + && !(etdev->PacketFilter & ET131X_PACKET_TYPE_PROMISCUOUS) + && !(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) { +- buf = rx_local->Fbr[rindex]-> +- Va[bindex]; ++ buf = rx_local->fbr[rindex]-> ++ virt[bindex]; + + /* Loop through our list to see if the + * destination address of this packet +@@ -984,7 +983,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + etdev->net_stats.rx_bytes += rfd->PacketSize; + + memcpy(skb_put(skb, rfd->PacketSize), +- rx_local->Fbr[rindex]->Va[bindex], ++ rx_local->fbr[rindex]->virt[bindex], + rfd->PacketSize); + + skb->dev = etdev->netdev; +@@ -1118,8 +1117,8 @@ void nic_return_rfd(struct et131x_adapte + * the PA / Buffer Index for the returned buffer into + * the oldest (next to be freed)FBR entry + */ +- next->addr_hi = rx_local->Fbr[1]->PAHigh[bi]; +- next->addr_lo = rx_local->Fbr[1]->PALow[bi]; ++ next->addr_hi = rx_local->fbr[1]->bus_high[bi]; ++ next->addr_lo = rx_local->fbr[1]->bus_low[bi]; + next->word2 = bi; + + writel(bump_fbr(&rx_local->local_Fbr1_full, +@@ -1136,8 +1135,8 @@ void nic_return_rfd(struct et131x_adapte + * the PA / Buffer Index for the returned buffer into + * the oldest (next to be freed) FBR entry + */ +- next->addr_hi = rx_local->Fbr[0]->PAHigh[bi]; +- next->addr_lo = rx_local->Fbr[0]->PALow[bi]; ++ next->addr_hi = rx_local->fbr[0]->bus_high[bi]; ++ next->addr_lo = rx_local->fbr[0]->bus_low[bi]; + next->word2 = bi; + + writel(bump_fbr(&rx_local->local_Fbr0_full, +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -230,13 +230,13 @@ struct rx_status_block { + /* + * Structure for look-up table holding free buffer ring pointers + */ +-typedef struct _FbrLookupTable { +- void *Va[MAX_DESC_PER_RING_RX]; +- void *Buffer1[MAX_DESC_PER_RING_RX]; +- void *Buffer2[MAX_DESC_PER_RING_RX]; +- u32 PAHigh[MAX_DESC_PER_RING_RX]; +- u32 PALow[MAX_DESC_PER_RING_RX]; +-} FBRLOOKUPTABLE, *PFBRLOOKUPTABLE; ++struct fbr_lookup { ++ void *virt[MAX_DESC_PER_RING_RX]; ++ void *buffer1[MAX_DESC_PER_RING_RX]; ++ void *buffer2[MAX_DESC_PER_RING_RX]; ++ u32 bus_high[MAX_DESC_PER_RING_RX]; ++ u32 bus_low[MAX_DESC_PER_RING_RX]; ++}; + + /* + * RX_RING_t is sructure representing the adaptor's local reference(s) to the +@@ -260,7 +260,7 @@ typedef struct _rx_ring_t { + dma_addr_t Fbr1MemPa[MAX_DESC_PER_RING_RX / FBR_CHUNKS]; + uint64_t Fbr1Realpa; + uint64_t Fbr1offset; +- FBRLOOKUPTABLE *Fbr[2]; ++ struct fbr_lookup *fbr[2]; /* One per ring */ + u32 local_Fbr1_full; + u32 Fbr1NumEntries; + u32 Fbr1BufferSize; diff --git a/staging/staging-et131x-clean-up-the-pkt_desc_stat_t-types.patch b/staging/staging-et131x-clean-up-the-pkt_desc_stat_t-types.patch new file mode 100644 index 00000000000000..7e949e3927ffdc --- /dev/null +++ b/staging/staging-et131x-clean-up-the-pkt_desc_stat_t-types.patch @@ -0,0 +1,327 @@ +From alan@linux.intel.com Wed Jan 27 15:43:45 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:02 +0000 +Subject: Staging: et131x: clean up the pkt_desc_stat_t types +To: greg@kroah.com +Message-ID: <20100118153401.6884.59474.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 49 ++++++------ + drivers/staging/et131x/et1310_rx.h | 140 ++++++++++++------------------------- + 2 files changed, 70 insertions(+), 119 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -193,7 +193,7 @@ int et131x_rx_dma_memory_alloc(struct et + &rx_ring->Fbr1Realpa, + &rx_ring->Fbr1offset, 0x0FFF); + +- rx_ring->pFbr1RingVa = (void *)((uint8_t *) rx_ring->pFbr1RingVa + ++ rx_ring->pFbr1RingVa = (void *)((u8 *) rx_ring->pFbr1RingVa + + rx_ring->Fbr1offset); + + #ifdef USE_FBR0 +@@ -222,7 +222,7 @@ int et131x_rx_dma_memory_alloc(struct et + &rx_ring->Fbr0Realpa, + &rx_ring->Fbr0offset, 0x0FFF); + +- rx_ring->pFbr0RingVa = (void *)((uint8_t *) rx_ring->pFbr0RingVa + ++ rx_ring->pFbr0RingVa = (void *)((u8 *) rx_ring->pFbr0RingVa + + rx_ring->Fbr0offset); + #endif + +@@ -270,7 +270,7 @@ int et131x_rx_dma_memory_alloc(struct et + * access later + */ + rx_ring->fbr[1]->virt[index] = +- (uint8_t *) rx_ring->Fbr1MemVa[i] + ++ (u8 *) rx_ring->Fbr1MemVa[i] + + (j * rx_ring->Fbr1BufferSize) + Fbr1Offset; + + /* now store the physical address in the descriptor +@@ -319,7 +319,7 @@ int et131x_rx_dma_memory_alloc(struct et + u32 index = (i * FBR_CHUNKS) + j; + + rx_ring->fbr[0]->virt[index] = +- (uint8_t *) rx_ring->Fbr0MemVa[i] + ++ (u8 *) rx_ring->Fbr0MemVa[i] + + (j * rx_ring->Fbr0BufferSize) + Fbr0Offset; + + rx_ring->fbr[0]->bus_high[index] = +@@ -338,7 +338,7 @@ int et131x_rx_dma_memory_alloc(struct et + + /* Allocate an area of memory for FIFO of Packet Status ring entries */ + pktStatRingSize = +- sizeof(PKT_STAT_DESC_t) * adapter->RxRing.PsrNumEntries; ++ sizeof(struct pkt_stat_desc) * adapter->RxRing.PsrNumEntries; + + rx_ring->pPSRingVa = pci_alloc_consistent(adapter->pdev, + pktStatRingSize, +@@ -446,7 +446,7 @@ void et131x_rx_dma_memory_free(struct et + } + + /* Now the FIFO itself */ +- rx_ring->pFbr1RingVa = (void *)((uint8_t *) ++ rx_ring->pFbr1RingVa = (void *)((u8 *) + rx_ring->pFbr1RingVa - rx_ring->Fbr1offset); + + bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr1NumEntries) +@@ -479,7 +479,7 @@ void et131x_rx_dma_memory_free(struct et + } + + /* Now the FIFO itself */ +- rx_ring->pFbr0RingVa = (void *)((uint8_t *) ++ rx_ring->pFbr0RingVa = (void *)((u8 *) + rx_ring->pFbr0RingVa - rx_ring->Fbr0offset); + + bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr0NumEntries) +@@ -496,7 +496,7 @@ void et131x_rx_dma_memory_free(struct et + /* Free Packet Status Ring */ + if (rx_ring->pPSRingVa) { + pktStatRingSize = +- sizeof(PKT_STAT_DESC_t) * adapter->RxRing.PsrNumEntries; ++ sizeof(struct pkt_stat_desc) * adapter->RxRing.PsrNumEntries; + + pci_free_consistent(adapter->pdev, pktStatRingSize, + rx_ring->pPSRingVa, rx_ring->pPSRingPa); +@@ -785,16 +785,16 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + { + struct _rx_ring_t *rx_local = &etdev->RxRing; + struct rx_status_block *status; +- PPKT_STAT_DESC_t psr; ++ struct pkt_stat_desc *psr; + PMP_RFD rfd; + u32 i; +- uint8_t *buf; ++ u8 *buf; + unsigned long flags; + struct list_head *element; +- uint8_t rindex; +- uint16_t bindex; ++ u8 rindex; ++ u16 bindex; + u32 len; +- PKT_STAT_DESC_WORD0_t Word0; ++ u32 word0; + u32 word1; + + /* RX Status block is written by the DMA engine prior to every +@@ -810,17 +810,17 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + return NULL; + + /* The packet status ring indicates that data is available. */ +- psr = (PPKT_STAT_DESC_t) (rx_local->pPSRingVa) + ++ psr = (struct pkt_stat_desc *) (rx_local->pPSRingVa) + + (rx_local->local_psr_full & 0xFFF); + + /* Grab any information that is required once the PSR is + * advanced, since we can no longer rely on the memory being + * accurate + */ +- len = psr->word1.bits.length; +- rindex = (uint8_t) psr->word1.bits.ri; +- bindex = (uint16_t) psr->word1.bits.bi; +- Word0 = psr->word0; ++ len = psr->word1 & 0xFFFF; ++ rindex = (psr->word1 >> 26) & 0x03; ++ bindex = (psr->word1 >> 16) & 0x3FF; ++ word0 = psr->word0; + + /* Indicate that we have used this PSR entry. */ + /* FIXME wrap 12 */ +@@ -835,9 +835,8 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + &etdev->regs->rxdma.psr_full_offset); + + #ifndef USE_FBR0 +- if (rindex != 1) { ++ if (rindex != 1) + return NULL; +- } + #endif + + #ifdef USE_FBR0 +@@ -904,8 +903,8 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + } + + /* Determine if this is a multicast packet coming in */ +- if ((Word0.value & ALCATEL_MULTICAST_PKT) && +- !(Word0.value & ALCATEL_BROADCAST_PKT)) { ++ if ((word0 & ALCATEL_MULTICAST_PKT) && ++ !(word0 & ALCATEL_BROADCAST_PKT)) { + /* Promiscuous mode and Multicast mode are + * not mutually exclusive as was first + * thought. I guess Promiscuous is just +@@ -956,7 +955,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + + if (len > 0) + etdev->Stats.multircv++; +- } else if (Word0.value & ALCATEL_BROADCAST_PKT) ++ } else if (word0 & ALCATEL_BROADCAST_PKT) + etdev->Stats.brdcstrcv++; + else + /* Not sure what this counter measures in +@@ -1094,8 +1093,8 @@ void nic_return_rfd(struct et131x_adapte + { + struct _rx_ring_t *rx_local = &etdev->RxRing; + struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; +- uint16_t bi = rfd->bufferindex; +- uint8_t ri = rfd->ringindex; ++ u16 bi = rfd->bufferindex; ++ u8 ri = rfd->ringindex; + unsigned long flags; + + /* We don't use any of the OOB data besides status. Otherwise, we +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -98,101 +98,53 @@ struct fbr_desc + u32 word2; /* Bits 10-31 reserved, 0-9 descriptor */ + }; + +-/* Typedefs for Packet Status Ring Descriptors */ +-typedef union _PKT_STAT_DESC_WORD0_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- /* top 16 bits are from the Alcatel Status Word as enumerated in */ +- /* PE-MCXMAC Data Sheet IPD DS54 0210-1 (also IPD-DS80 0205-2) */ +-#if 0 +- u32 asw_trunc:1; /* bit 31(Rx frame truncated) */ +-#endif +- u32 asw_long_evt:1; /* bit 31(Rx long event) */ +- u32 asw_VLAN_tag:1; /* bit 30(VLAN tag detected) */ +- u32 asw_unsupported_op:1; /* bit 29(unsupported OP code) */ +- u32 asw_pause_frame:1; /* bit 28(is a pause frame) */ +- u32 asw_control_frame:1; /* bit 27(is a control frame) */ +- u32 asw_dribble_nibble:1; /* bit 26(spurious bits after EOP) */ +- u32 asw_broadcast:1; /* bit 25(has a broadcast address) */ +- u32 asw_multicast:1; /* bit 24(has a multicast address) */ +- u32 asw_OK:1; /* bit 23(valid CRC + no code error) */ +- u32 asw_too_long:1; /* bit 22(frame length > 1518 bytes) */ +- u32 asw_len_chk_err:1; /* bit 21(frame length field incorrect) */ +- u32 asw_CRC_err:1; /* bit 20(CRC error) */ +- u32 asw_code_err:1; /* bit 19(one or more nibbles signalled as errors) */ +- u32 asw_false_carrier_event:1; /* bit 18(bad carrier since last good packet) */ +- u32 asw_RX_DV_event:1; /* bit 17(short receive event detected) */ +- u32 asw_prev_pkt_dropped:1;/* bit 16(e.g. IFG too small on previous) */ +- u32 unused:5; /* bits 11-15 */ +- u32 vp:1; /* bit 10(VLAN Packet) */ +- u32 jp:1; /* bit 9(Jumbo Packet) */ +- u32 ft:1; /* bit 8(Frame Truncated) */ +- u32 drop:1; /* bit 7(Drop packet) */ +- u32 rxmac_error:1; /* bit 6(RXMAC Error Indicator) */ +- u32 wol:1; /* bit 5(WOL Event) */ +- u32 tcpp:1; /* bit 4(TCP checksum pass) */ +- u32 tcpa:1; /* bit 3(TCP checksum assist) */ +- u32 ipp:1; /* bit 2(IP checksum pass) */ +- u32 ipa:1; /* bit 1(IP checksum assist) */ +- u32 hp:1; /* bit 0(hash pass) */ +-#else +- u32 hp:1; /* bit 0(hash pass) */ +- u32 ipa:1; /* bit 1(IP checksum assist) */ +- u32 ipp:1; /* bit 2(IP checksum pass) */ +- u32 tcpa:1; /* bit 3(TCP checksum assist) */ +- u32 tcpp:1; /* bit 4(TCP checksum pass) */ +- u32 wol:1; /* bit 5(WOL Event) */ +- u32 rxmac_error:1; /* bit 6(RXMAC Error Indicator) */ +- u32 drop:1; /* bit 7(Drop packet) */ +- u32 ft:1; /* bit 8(Frame Truncated) */ +- u32 jp:1; /* bit 9(Jumbo Packet) */ +- u32 vp:1; /* bit 10(VLAN Packet) */ +- u32 unused:5; /* bits 11-15 */ +- u32 asw_prev_pkt_dropped:1;/* bit 16(e.g. IFG too small on previous) */ +- u32 asw_RX_DV_event:1; /* bit 17(short receive event detected) */ +- u32 asw_false_carrier_event:1; /* bit 18(bad carrier since last good packet) */ +- u32 asw_code_err:1; /* bit 19(one or more nibbles signalled as errors) */ +- u32 asw_CRC_err:1; /* bit 20(CRC error) */ +- u32 asw_len_chk_err:1; /* bit 21(frame length field incorrect) */ +- u32 asw_too_long:1; /* bit 22(frame length > 1518 bytes) */ +- u32 asw_OK:1; /* bit 23(valid CRC + no code error) */ +- u32 asw_multicast:1; /* bit 24(has a multicast address) */ +- u32 asw_broadcast:1; /* bit 25(has a broadcast address) */ +- u32 asw_dribble_nibble:1; /* bit 26(spurious bits after EOP) */ +- u32 asw_control_frame:1; /* bit 27(is a control frame) */ +- u32 asw_pause_frame:1; /* bit 28(is a pause frame) */ +- u32 asw_unsupported_op:1; /* bit 29(unsupported OP code) */ +- u32 asw_VLAN_tag:1; /* bit 30(VLAN tag detected) */ +- u32 asw_long_evt:1; /* bit 31(Rx long event) */ +-#if 0 +- u32 asw_trunc:1; /* bit 31(Rx frame truncated) */ +-#endif +-#endif +- } bits; +-} PKT_STAT_DESC_WORD0_t, *PPKT_STAT_WORD0_t; +- +-typedef union _PKT_STAT_DESC_WORD1_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused:4; /* bits 28-31 */ +- u32 ri:2; /* bits 26-27(Ring Index) */ +- u32 bi:10; /* bits 16-25(Buffer Index) */ +- u32 length:16; /* bit 0-15(length in bytes) */ +-#else +- u32 length:16; /* bit 0-15(length in bytes) */ +- u32 bi:10; /* bits 16-25(Buffer Index) */ +- u32 ri:2; /* bits 26-27(Ring Index) */ +- u32 unused:4; /* bits 28-31 */ +-#endif +- } bits; +-} PKT_STAT_DESC_WORD1_t, *PPKT_STAT_WORD1_t; ++/* Packet Status Ring Descriptors ++ * ++ * Word 0: ++ * ++ * top 16 bits are from the Alcatel Status Word as enumerated in ++ * PE-MCXMAC Data Sheet IPD DS54 0210-1 (also IPD-DS80 0205-2) ++ * ++ * 0: hp hash pass ++ * 1: ipa IP checksum assist ++ * 2: ipp IP checksum pass ++ * 3: tcpa TCP checksum assist ++ * 4: tcpp TCP checksum pass ++ * 5: wol WOL Event ++ * 6: rxmac_error RXMAC Error Indicator ++ * 7: drop Drop packet ++ * 8: ft Frame Truncated ++ * 9: jp Jumbo Packet ++ * 10: vp VLAN Packet ++ * 11-15: unused ++ * 16: asw_prev_pkt_dropped e.g. IFG too small on previous ++ * 17: asw_RX_DV_event short receive event detected ++ * 18: asw_false_carrier_event bad carrier since last good packet ++ * 19: asw_code_err one or more nibbles signalled as errors ++ * 20: asw_CRC_err CRC error ++ * 21: asw_len_chk_err frame length field incorrect ++ * 22: asw_too_long frame length > 1518 bytes ++ * 23: asw_OK valid CRC + no code error ++ * 24: asw_multicast has a multicast address ++ * 25: asw_broadcast has a broadcast address ++ * 26: asw_dribble_nibble spurious bits after EOP ++ * 27: asw_control_frame is a control frame ++ * 28: asw_pause_frame is a pause frame ++ * 29: asw_unsupported_op unsupported OP code ++ * 30: asw_VLAN_tag VLAN tag detected ++ * 31: asw_long_evt Rx long event ++ * ++ * Word 1: ++ * 0-15: length length in bytes ++ * 16-25: bi Buffer Index ++ * 26-27: ri Ring Index ++ * 28-31: reserved ++ */ + +-typedef struct _PKT_STAT_DESC_t { +- PKT_STAT_DESC_WORD0_t word0; +- PKT_STAT_DESC_WORD1_t word1; +-} PKT_STAT_DESC_t, *PPKT_STAT_DESC_t; ++struct pkt_stat_desc { ++ u32 word0; ++ u32 word1; ++}; + + /* Typedefs for the RX DMA status word */ + diff --git a/staging/staging-et131x-clean-up-the-rx-status-word-types.patch b/staging/staging-et131x-clean-up-the-rx-status-word-types.patch new file mode 100644 index 00000000000000..16f08d02727a04 --- /dev/null +++ b/staging/staging-et131x-clean-up-the-rx-status-word-types.patch @@ -0,0 +1,89 @@ +From alan@linux.intel.com Wed Jan 27 15:42:58 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:34 +0000 +Subject: Staging: et131x: Clean up the rx status word types +To: greg@kroah.com +Message-ID: <20100118153334.6884.71437.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 10 ++++------ + drivers/staging/et131x/et1310_rx.h | 28 ++++++---------------------- + 2 files changed, 10 insertions(+), 28 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -797,21 +797,19 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + uint16_t bindex; + u32 len; + PKT_STAT_DESC_WORD0_t Word0; ++ u32 word1; + + /* RX Status block is written by the DMA engine prior to every + * interrupt. It contains the next to be used entry in the Packet + * Status Ring, and also the two Free Buffer rings. + */ + status = (PRX_STATUS_BLOCK_t) rx_local->pRxStatusVa; ++ word1 = status->Word1 >> 16; /* Get the useful bits */ + +- /* FIXME: tidy later when conversions complete */ +- if (status->Word1.bits.PSRoffset == +- (rx_local->local_psr_full & 0xFFF) && +- status->Word1.bits.PSRwrap == +- ((rx_local->local_psr_full >> 12) & 1)) { ++ /* Check the PSR and wrap bits do not match */ ++ if ((word1 & 0x1FFF) == (rx_local->local_psr_full & 0x1FFF)) + /* Looks like this ring is not updated yet */ + return NULL; +- } + + /* The packet status ring indicates that data is available. */ + psr = (PPKT_STAT_DESC_t) (rx_local->pPSRingVa) + +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -211,36 +211,20 @@ typedef struct _PKT_STAT_DESC_t { + * RXSTAT_WORD1_t structure holds part of the status bits of the Rx DMA engine + * that get copied out to memory by the ET-1310. Word 3 is a 32 bit word + * which contains the Packet Status Ring available offset. ++ * ++ * bit 0-15 reserved ++ * bit 16-27 PSRoffset ++ * bit 28 PSRwrap ++ * bit 29-31 unused + */ + +-#define RXSTAT1_OFFSET 16 +-#define RXSTAT1_MASK 0xFFF +-#define RXSTAT1_WRAP 0x10000000 +- +-typedef union _rxstat_word1_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 PSRunused:3; /* bits 29-31 */ +- u32 PSRwrap:1; /* bit 28 */ +- u32 PSRoffset:12; /* bits 16-27 */ +- u32 reserved:16; /* bits 0-15 */ +-#else +- u32 reserved:16; /* bits 0-15 */ +- u32 PSRoffset:12; /* bits 16-27 */ +- u32 PSRwrap:1; /* bit 28 */ +- u32 PSRunused:3; /* bits 29-31 */ +-#endif +- } bits; +-} RXSTAT_WORD1_t, *PRXSTAT_WORD1_t; +- + /* + * RX_STATUS_BLOCK_t is sructure representing the status of the Rx DMA engine + * it sits in free memory, and is pointed to by 0x101c / 0x1020 + */ + typedef struct _rx_status_block_t { + u32 Word0; +- RXSTAT_WORD1_t Word1; ++ u32 Word1; + } RX_STATUS_BLOCK_t, *PRX_STATUS_BLOCK_t; + + /* diff --git a/staging/staging-et131x-collapse-all-the-function-definitions-into-one-place.patch b/staging/staging-et131x-collapse-all-the-function-definitions-into-one-place.patch new file mode 100644 index 00000000000000..9b20128ac0cf4a --- /dev/null +++ b/staging/staging-et131x-collapse-all-the-function-definitions-into-one-place.patch @@ -0,0 +1,1246 @@ +From alan@linux.intel.com Wed Jan 27 15:44:14 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:24 +0000 +Subject: Staging: et131x: Collapse all the function definitions into one place +To: greg@kroah.com +Message-ID: <20100118153424.6884.40878.stgit@localhost.localdomain> + + +We have lots of tiny files right now that could be one + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_eeprom.c | 41 ++++++-- + drivers/staging/et131x/et1310_eeprom.h | 103 --------------------- + drivers/staging/et131x/et1310_jagcore.h | 94 ------------------- + drivers/staging/et131x/et1310_mac.c | 17 ++- + drivers/staging/et131x/et1310_mac.h | 93 ------------------- + drivers/staging/et131x/et1310_phy.c | 7 - + drivers/staging/et131x/et1310_phy.h | 34 ------- + drivers/staging/et131x/et1310_pm.c | 6 - + drivers/staging/et131x/et1310_pm.h | 85 ----------------- + drivers/staging/et131x/et1310_rx.c | 7 - + drivers/staging/et131x/et1310_rx.h | 24 ----- + drivers/staging/et131x/et1310_tx.c | 8 - + drivers/staging/et131x/et1310_tx.h | 14 -- + drivers/staging/et131x/et131x.h | 153 ++++++++++++++++++++++++++++++++ + drivers/staging/et131x/et131x_adapter.h | 14 ++ + drivers/staging/et131x/et131x_config.h | 67 -------------- + drivers/staging/et131x/et131x_initpci.c | 10 -- + drivers/staging/et131x/et131x_initpci.h | 73 --------------- + drivers/staging/et131x/et131x_isr.c | 24 ++++- + drivers/staging/et131x/et131x_isr.h | 65 ------------- + drivers/staging/et131x/et131x_netdev.c | 7 - + drivers/staging/et131x/et131x_netdev.h | 64 ------------- + drivers/staging/et131x/et131x_version.h | 9 - + 23 files changed, 242 insertions(+), 777 deletions(-) + +--- a/drivers/staging/et131x/et1310_eeprom.c ++++ b/drivers/staging/et131x/et1310_eeprom.c +@@ -84,17 +84,42 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +-#include "et1310_eeprom.h" +- + #include "et131x_adapter.h" +-#include "et131x_initpci.h" +-#include "et131x_isr.h" +- +-#include "et1310_tx.h" ++#include "et131x.h" + ++/* ++ * EEPROM Defines ++ */ + ++/* LBCIF Register Groups (addressed via 32-bit offsets) */ ++#define LBCIF_DWORD0_GROUP 0xAC ++#define LBCIF_DWORD1_GROUP 0xB0 ++ ++/* LBCIF Registers (addressed via 8-bit offsets) */ ++#define LBCIF_ADDRESS_REGISTER 0xAC ++#define LBCIF_DATA_REGISTER 0xB0 ++#define LBCIF_CONTROL_REGISTER 0xB1 ++#define LBCIF_STATUS_REGISTER 0xB2 ++ ++/* LBCIF Control Register Bits */ ++#define LBCIF_CONTROL_SEQUENTIAL_READ 0x01 ++#define LBCIF_CONTROL_PAGE_WRITE 0x02 ++#define LBCIF_CONTROL_EEPROM_RELOAD 0x08 ++#define LBCIF_CONTROL_TWO_BYTE_ADDR 0x20 ++#define LBCIF_CONTROL_I2C_WRITE 0x40 ++#define LBCIF_CONTROL_LBCIF_ENABLE 0x80 ++ ++/* LBCIF Status Register Bits */ ++#define LBCIF_STATUS_PHY_QUEUE_AVAIL 0x01 ++#define LBCIF_STATUS_I2C_IDLE 0x02 ++#define LBCIF_STATUS_ACK_ERROR 0x04 ++#define LBCIF_STATUS_GENERAL_ERROR 0x08 ++#define LBCIF_STATUS_CHECKSUM_ERROR 0x40 ++#define LBCIF_STATUS_EEPROM_PRESENT 0x80 ++ ++/* Miscellaneous Constraints */ ++#define MAX_NUM_REGISTER_POLLS 1000 ++#define MAX_NUM_WRITE_RETRIES 2 + + static int eeprom_wait_ready(struct pci_dev *pdev, u32 *status) + { +--- a/drivers/staging/et131x/et1310_eeprom.h ++++ /dev/null +@@ -1,103 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et1310_eeprom.h - Defines, structs, enums, prototypes, etc. used for EEPROM +- * access routines +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET1310_EEPROM_H__ +-#define __ET1310_EEPROM_H__ +- +-#include "et1310_address_map.h" +- +-/* +- * EEPROM Defines +- */ +- +-/* LBCIF Register Groups (addressed via 32-bit offsets) */ +-#define LBCIF_DWORD0_GROUP 0xAC +-#define LBCIF_DWORD1_GROUP 0xB0 +- +-/* LBCIF Registers (addressed via 8-bit offsets) */ +-#define LBCIF_ADDRESS_REGISTER 0xAC +-#define LBCIF_DATA_REGISTER 0xB0 +-#define LBCIF_CONTROL_REGISTER 0xB1 +-#define LBCIF_STATUS_REGISTER 0xB2 +- +-/* LBCIF Control Register Bits */ +-#define LBCIF_CONTROL_SEQUENTIAL_READ 0x01 +-#define LBCIF_CONTROL_PAGE_WRITE 0x02 +-#define LBCIF_CONTROL_EEPROM_RELOAD 0x08 +-#define LBCIF_CONTROL_TWO_BYTE_ADDR 0x20 +-#define LBCIF_CONTROL_I2C_WRITE 0x40 +-#define LBCIF_CONTROL_LBCIF_ENABLE 0x80 +- +-/* LBCIF Status Register Bits */ +-#define LBCIF_STATUS_PHY_QUEUE_AVAIL 0x01 +-#define LBCIF_STATUS_I2C_IDLE 0x02 +-#define LBCIF_STATUS_ACK_ERROR 0x04 +-#define LBCIF_STATUS_GENERAL_ERROR 0x08 +-#define LBCIF_STATUS_CHECKSUM_ERROR 0x40 +-#define LBCIF_STATUS_EEPROM_PRESENT 0x80 +- +-/* Miscellaneous Constraints */ +-#define MAX_NUM_REGISTER_POLLS 1000 +-#define MAX_NUM_WRITE_RETRIES 2 +- +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-int et131x_init_eeprom(struct et131x_adapter *etdev); +- +-#endif /* _ET1310_EEPROM_H_ */ +--- a/drivers/staging/et131x/et1310_jagcore.h ++++ /dev/null +@@ -1,94 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et1310_jagcore.h - Defines, structs, enums, prototypes, etc. pertaining to +- * the JAGCore +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET1310_JAGCORE_H__ +-#define __ET1310_JAGCORE_H__ +- +-#include "et1310_address_map.h" +- +- +-#define INTERNAL_MEM_SIZE 0x400 /* 1024 of internal memory */ +-#define INTERNAL_MEM_RX_OFFSET 0x1FF /* 50% Tx, 50% Rx */ +- +-/* +- * For interrupts, normal running is: +- * rxdma_xfr_done, phy_interrupt, mac_stat_interrupt, +- * watchdog_interrupt & txdma_xfer_done +- * +- * In both cases, when flow control is enabled for either Tx or bi-direction, +- * we additional enable rx_fbr0_low and rx_fbr1_low, so we know when the +- * buffer rings are running low. +- */ +-#define INT_MASK_DISABLE 0xffffffff +- +-/* NOTE: Masking out MAC_STAT Interrupt for now... +- * #define INT_MASK_ENABLE 0xfff6bf17 +- * #define INT_MASK_ENABLE_NO_FLOW 0xfff6bfd7 +- */ +-#define INT_MASK_ENABLE 0xfffebf17 +-#define INT_MASK_ENABLE_NO_FLOW 0xfffebfd7 +- +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-void ConfigGlobalRegs(struct et131x_adapter *pAdapter); +-void ConfigMMCRegs(struct et131x_adapter *pAdapter); +-void et131x_enable_interrupts(struct et131x_adapter *adapter); +-void et131x_disable_interrupts(struct et131x_adapter *adapter); +- +-#endif /* __ET1310_JAGCORE_H__ */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -85,12 +85,19 @@ + #include <linux/crc32.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +-#include "et1310_mac.h" +- + #include "et131x_adapter.h" +-#include "et131x_initpci.h" ++#include "et131x.h" ++ ++ ++#define COUNTER_WRAP_28_BIT 0x10000000 ++#define COUNTER_WRAP_22_BIT 0x400000 ++#define COUNTER_WRAP_16_BIT 0x10000 ++#define COUNTER_WRAP_12_BIT 0x1000 ++ ++#define COUNTER_MASK_28_BIT (COUNTER_WRAP_28_BIT - 1) ++#define COUNTER_MASK_22_BIT (COUNTER_WRAP_22_BIT - 1) ++#define COUNTER_MASK_16_BIT (COUNTER_WRAP_16_BIT - 1) ++#define COUNTER_MASK_12_BIT (COUNTER_WRAP_12_BIT - 1) + + /** + * ConfigMacRegs1 - Initialize the first part of MAC regs +--- a/drivers/staging/et131x/et1310_mac.h ++++ /dev/null +@@ -1,93 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et1310_mac.h - Defines, structs, enums, prototypes, etc. pertaining to the +- * MAC. +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef _ET1310_MAC_H_ +-#define _ET1310_MAC_H_ +- +- +-#include "et1310_address_map.h" +- +- +-#define COUNTER_WRAP_28_BIT 0x10000000 +-#define COUNTER_WRAP_22_BIT 0x400000 +-#define COUNTER_WRAP_16_BIT 0x10000 +-#define COUNTER_WRAP_12_BIT 0x1000 +- +-#define COUNTER_MASK_28_BIT (COUNTER_WRAP_28_BIT - 1) +-#define COUNTER_MASK_22_BIT (COUNTER_WRAP_22_BIT - 1) +-#define COUNTER_MASK_16_BIT (COUNTER_WRAP_16_BIT - 1) +-#define COUNTER_MASK_12_BIT (COUNTER_WRAP_12_BIT - 1) +- +-#define UPDATE_COUNTER(HostCnt, DevCnt) \ +- HostCnt = HostCnt + DevCnt; +- +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-void ConfigMACRegs1(struct et131x_adapter *adapter); +-void ConfigMACRegs2(struct et131x_adapter *adapter); +-void ConfigRxMacRegs(struct et131x_adapter *adapter); +-void ConfigTxMacRegs(struct et131x_adapter *adapter); +-void ConfigMacStatRegs(struct et131x_adapter *adapter); +-void ConfigFlowControl(struct et131x_adapter *adapter); +-void UpdateMacStatHostCounters(struct et131x_adapter *adapter); +-void HandleMacStatInterrupt(struct et131x_adapter *adapter); +-void SetupDeviceForMulticast(struct et131x_adapter *adapter); +-void SetupDeviceForUnicast(struct et131x_adapter *adapter); +- +-#endif /* _ET1310_MAC_H_ */ +--- a/drivers/staging/et131x/et1310_phy.c ++++ b/drivers/staging/et131x/et1310_phy.c +@@ -85,17 +85,14 @@ + #include <linux/random.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" + + #include "et131x_adapter.h" +-#include "et131x_netdev.h" +-#include "et131x_initpci.h" + + #include "et1310_address_map.h" + #include "et1310_tx.h" + #include "et1310_rx.h" +-#include "et1310_mac.h" ++ ++#include "et131x.h" + + /* Prototypes for functions with local scope */ + static void et131x_xcvr_init(struct et131x_adapter *etdev); +--- a/drivers/staging/et131x/et1310_phy.h ++++ b/drivers/staging/et131x/et1310_phy.h +@@ -736,32 +736,8 @@ typedef union _MI_LCR2_t { + + /* MI Register 29 - 31: Reserved Reg(0x1D - 0x1E) */ + +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; + + /* Prototypes for ET1310_phy.c */ +-int et131x_xcvr_find(struct et131x_adapter *adapter); +-void et131x_setphy_normal(struct et131x_adapter *adapter); +- +-/* static inline function does not work because et131x_adapter is not always +- * defined +- */ +-int PhyMiRead(struct et131x_adapter *adapter, u8 xcvrAddr, +- u8 xcvrReg, u16 *value); +-#define MiRead(adapter, xcvrReg, value) \ +- PhyMiRead((adapter), (adapter)->Stats.xcvr_addr, (xcvrReg), (value)) +- +-int32_t MiWrite(struct et131x_adapter *adapter, +- u8 xcvReg, u16 value); +-void et131x_Mii_check(struct et131x_adapter *pAdapter, +- MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints); +- +-/* This last is not strictly required (the driver could call the TPAL +- * version instead), but this sets the adapter up correctly, and calls the +- * access routine indirectly. This protects the driver from changes in TPAL. +- */ +-void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter); +- + /* Defines for PHY access routines */ + + /* Define bit operation flags */ +@@ -843,14 +819,4 @@ void SetPhy_10BaseTHalfDuplex(struct et1 + /* #define TRU_VMI_LINK_CONTROL_REGISTER 29 */ + /* #define TRU_VMI_TIMING_CONTROL_REGISTER */ + +-/* Prototypes for PHY access routines */ +-void ET1310_PhyInit(struct et131x_adapter *adapter); +-void ET1310_PhyReset(struct et131x_adapter *adapter); +-void ET1310_PhyPowerDown(struct et131x_adapter *adapter, bool down); +-void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *adapter, +- u16 duplex); +-void ET1310_PhyAccessMiBit(struct et131x_adapter *adapter, +- u16 action, +- u16 regnum, u16 bitnum, u8 *value); +- + #endif /* _ET1310_PHY_H_ */ +--- a/drivers/staging/et131x/et1310_pm.c ++++ b/drivers/staging/et131x/et1310_pm.c +@@ -83,13 +83,9 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +-#include "et1310_mac.h" + #include "et1310_rx.h" +- + #include "et131x_adapter.h" +-#include "et131x_initpci.h" ++#include "et131x.h" + + /** + * EnablePhyComa - called when network cable is unplugged +--- a/drivers/staging/et131x/et1310_pm.h ++++ /dev/null +@@ -1,85 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et1310_pm.h - Defines, structs, enums, prototypes, etc. pertaining to power +- * management. +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef _ET1310_PM_H_ +-#define _ET1310_PM_H_ +- +-#include "et1310_address_map.h" +- +-typedef struct _MP_POWER_MGMT { +- /* variable putting the phy into coma mode when boot up with no cable +- * plugged in after 5 seconds +- */ +- u8 TransPhyComaModeOnBoot; +- +- /* Next two used to save power information at power down. This +- * information will be used during power up to set up parts of Power +- * Management in JAGCore +- */ +- u16 PowerDownSpeed; +- u8 PowerDownDuplex; +-} MP_POWER_MGMT, *PMP_POWER_MGMT; +- +-/* Forward declaration of the private adapter structure +- */ +-struct et131x_adapter; +- +-void EnablePhyComa(struct et131x_adapter *adapter); +-void DisablePhyComa(struct et131x_adapter *adapter); +- +-#endif /* _ET1310_PM_H_ */ +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -84,14 +84,9 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +- + #include "et131x_adapter.h" +-#include "et131x_initpci.h" +- + #include "et1310_rx.h" +- ++#include "et131x.h" + + void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD pMpRfd); + +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -241,28 +241,4 @@ struct rx_ring { + struct kmem_cache *RecvLookaside; + }; + +-/* Forward reference of RFD */ +-struct _MP_RFD; +- +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-/* PROTOTYPES for Initialization */ +-int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter); +-void et131x_rx_dma_memory_free(struct et131x_adapter *adapter); +-int et131x_rfd_resources_alloc(struct et131x_adapter *adapter, +- struct _MP_RFD *pMpRfd); +-void et131x_rfd_resources_free(struct et131x_adapter *adapter, +- struct _MP_RFD *pMpRfd); +-int et131x_init_recv(struct et131x_adapter *adapter); +- +-void ConfigRxDmaRegs(struct et131x_adapter *adapter); +-void SetRxDmaTimer(struct et131x_adapter *adapter); +-void et131x_rx_dma_disable(struct et131x_adapter *adapter); +-void et131x_rx_dma_enable(struct et131x_adapter *adapter); +- +-void et131x_reset_recv(struct et131x_adapter *adapter); +- +-void et131x_handle_recv_interrupt(struct et131x_adapter *adapter); +- + #endif /* __ET1310_RX_H__ */ +--- a/drivers/staging/et131x/et1310_tx.c ++++ b/drivers/staging/et131x/et1310_tx.c +@@ -84,15 +84,9 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +- + #include "et131x_adapter.h" +-#include "et131x_initpci.h" +-#include "et131x_isr.h" +- + #include "et1310_tx.h" +- ++#include "et131x.h" + + static inline void et131x_free_send_packet(struct et131x_adapter *etdev, + struct tcb *tcb); +--- a/drivers/staging/et131x/et1310_tx.h ++++ b/drivers/staging/et131x/et1310_tx.h +@@ -147,18 +147,4 @@ struct tx_ring { + int since_irq; + }; + +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-/* PROTOTYPES for et1310_tx.c */ +-int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter); +-void et131x_tx_dma_memory_free(struct et131x_adapter *adapter); +-void ConfigTxDmaRegs(struct et131x_adapter *adapter); +-void et131x_init_send(struct et131x_adapter *adapter); +-void et131x_tx_dma_disable(struct et131x_adapter *adapter); +-void et131x_tx_dma_enable(struct et131x_adapter *adapter); +-void et131x_handle_send_interrupt(struct et131x_adapter *adapter); +-void et131x_free_busy_send_packets(struct et131x_adapter *adapter); +-int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev); +- + #endif /* __ET1310_TX_H__ */ +--- a/drivers/staging/et131x/et131x_adapter.h ++++ b/drivers/staging/et131x/et131x_adapter.h +@@ -147,6 +147,20 @@ typedef struct _ce_stats_t { + u32 InterruptStatus; + } CE_STATS_t, *PCE_STATS_t; + ++typedef struct _MP_POWER_MGMT { ++ /* variable putting the phy into coma mode when boot up with no cable ++ * plugged in after 5 seconds ++ */ ++ u8 TransPhyComaModeOnBoot; ++ ++ /* Next two used to save power information at power down. This ++ * information will be used during power up to set up parts of Power ++ * Management in JAGCore ++ */ ++ u16 PowerDownSpeed; ++ u8 PowerDownDuplex; ++} MP_POWER_MGMT, *PMP_POWER_MGMT; ++ + /* The private adapter structure */ + struct et131x_adapter { + struct net_device *netdev; +--- a/drivers/staging/et131x/et131x_config.h ++++ /dev/null +@@ -1,67 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright � 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et131x_config.h - Defines, structs, enums, prototypes, etc. to support +- * et131x_config.c +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright � 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED �AS IS� AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET131X_CONFIG_H__ +-#define __ET131X_CONFIG_H__ +- +-/* Forward declaration of the private adapter structure */ +-struct et131x_adapter; +- +-void et131x_config_parse(struct et131x_adapter *adapter); +- +-#endif /* __ET131X_CONFIG_H__ */ +--- /dev/null ++++ b/drivers/staging/et131x/et131x.h +@@ -0,0 +1,153 @@ ++/* ++ * Merged from files ++ * ++ * Copyright © 2005 Agere Systems Inc. ++ * All rights reserved. ++ * http://www.agere.com ++ * ++ * SOFTWARE LICENSE ++ * ++ * This software is provided subject to the following terms and conditions, ++ * which you should read carefully before using the software. Using this ++ * software indicates your acceptance of these terms and conditions. If you do ++ * not agree with these terms and conditions, do not use the software. ++ * ++ * Copyright © 2005 Agere Systems Inc. ++ * All rights reserved. ++ * ++ * Redistribution and use in source or binary forms, with or without ++ * modifications, are permitted provided that the following conditions are met: ++ * ++ * . Redistributions of source code must retain the above copyright notice, this ++ * list of conditions and the following Disclaimer as comments in the code as ++ * well as in the documentation and/or other materials provided with the ++ * distribution. ++ * ++ * . Redistributions in binary form must reproduce the above copyright notice, ++ * this list of conditions and the following Disclaimer in the documentation ++ * and/or other materials provided with the distribution. ++ * ++ * . Neither the name of Agere Systems Inc. nor the names of the contributors ++ * may be used to endorse or promote products derived from this software ++ * without specific prior written permission. ++ * ++ * Disclaimer ++ * ++ * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, ++ * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF ++ * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY ++ * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN ++ * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. ++ * ++ */ ++ ++/* et131x_eeprom.c */ ++int et131x_init_eeprom(struct et131x_adapter *etdev); ++ ++/* et131x_initpci.c */ ++void ConfigGlobalRegs(struct et131x_adapter *pAdapter); ++void ConfigMMCRegs(struct et131x_adapter *pAdapter); ++void et131x_enable_interrupts(struct et131x_adapter *adapter); ++void et131x_disable_interrupts(struct et131x_adapter *adapter); ++void et131x_align_allocated_memory(struct et131x_adapter *adapter, ++ u64 *phys_addr, ++ u64 *offset, u64 mask); ++ ++int et131x_adapter_setup(struct et131x_adapter *adapter); ++int et131x_adapter_memory_alloc(struct et131x_adapter *adapter); ++void et131x_adapter_memory_free(struct et131x_adapter *adapter); ++void et131x_hwaddr_init(struct et131x_adapter *adapter); ++void et131x_soft_reset(struct et131x_adapter *adapter); ++ ++/* et131x_isr.c */ ++irqreturn_t et131x_isr(int irq, void *dev_id); ++void et131x_isr_handler(struct work_struct *work); ++ ++/* et1310_mac.c */ ++void ConfigMACRegs1(struct et131x_adapter *adapter); ++void ConfigMACRegs2(struct et131x_adapter *adapter); ++void ConfigRxMacRegs(struct et131x_adapter *adapter); ++void ConfigTxMacRegs(struct et131x_adapter *adapter); ++void ConfigMacStatRegs(struct et131x_adapter *adapter); ++void ConfigFlowControl(struct et131x_adapter *adapter); ++void UpdateMacStatHostCounters(struct et131x_adapter *adapter); ++void HandleMacStatInterrupt(struct et131x_adapter *adapter); ++void SetupDeviceForMulticast(struct et131x_adapter *adapter); ++void SetupDeviceForUnicast(struct et131x_adapter *adapter); ++ ++/* et131x_netdev.c */ ++struct net_device *et131x_device_alloc(void); ++ ++/* et131x_pm.c */ ++void EnablePhyComa(struct et131x_adapter *adapter); ++void DisablePhyComa(struct et131x_adapter *adapter); ++ ++/* et131x_phy.c */ ++void ET1310_PhyInit(struct et131x_adapter *adapter); ++void ET1310_PhyReset(struct et131x_adapter *adapter); ++void ET1310_PhyPowerDown(struct et131x_adapter *adapter, bool down); ++void ET1310_PhyAdvertise1000BaseT(struct et131x_adapter *adapter, ++ u16 duplex); ++void ET1310_PhyAccessMiBit(struct et131x_adapter *adapter, ++ u16 action, ++ u16 regnum, u16 bitnum, u8 *value); ++ ++int et131x_xcvr_find(struct et131x_adapter *adapter); ++void et131x_setphy_normal(struct et131x_adapter *adapter); ++ ++/* static inline function does not work because et131x_adapter is not always ++ * defined ++ */ ++int PhyMiRead(struct et131x_adapter *adapter, u8 xcvrAddr, ++ u8 xcvrReg, u16 *value); ++#define MiRead(adapter, xcvrReg, value) \ ++ PhyMiRead((adapter), (adapter)->Stats.xcvr_addr, (xcvrReg), (value)) ++ ++int32_t MiWrite(struct et131x_adapter *adapter, ++ u8 xcvReg, u16 value); ++void et131x_Mii_check(struct et131x_adapter *pAdapter, ++ MI_BMSR_t bmsr, MI_BMSR_t bmsr_ints); ++ ++/* This last is not strictly required (the driver could call the TPAL ++ * version instead), but this sets the adapter up correctly, and calls the ++ * access routine indirectly. This protects the driver from changes in TPAL. ++ */ ++void SetPhy_10BaseTHalfDuplex(struct et131x_adapter *adapter); ++ ++ ++/* et1310_rx.c */ ++int et131x_rx_dma_memory_alloc(struct et131x_adapter *adapter); ++void et131x_rx_dma_memory_free(struct et131x_adapter *adapter); ++int et131x_rfd_resources_alloc(struct et131x_adapter *adapter, ++ struct _MP_RFD *pMpRfd); ++void et131x_rfd_resources_free(struct et131x_adapter *adapter, ++ struct _MP_RFD *pMpRfd); ++int et131x_init_recv(struct et131x_adapter *adapter); ++ ++void ConfigRxDmaRegs(struct et131x_adapter *adapter); ++void SetRxDmaTimer(struct et131x_adapter *adapter); ++void et131x_rx_dma_disable(struct et131x_adapter *adapter); ++void et131x_rx_dma_enable(struct et131x_adapter *adapter); ++ ++void et131x_reset_recv(struct et131x_adapter *adapter); ++ ++void et131x_handle_recv_interrupt(struct et131x_adapter *adapter); ++ ++/* et131x_tx.c */ ++int et131x_tx_dma_memory_alloc(struct et131x_adapter *adapter); ++void et131x_tx_dma_memory_free(struct et131x_adapter *adapter); ++void ConfigTxDmaRegs(struct et131x_adapter *adapter); ++void et131x_init_send(struct et131x_adapter *adapter); ++void et131x_tx_dma_disable(struct et131x_adapter *adapter); ++void et131x_tx_dma_enable(struct et131x_adapter *adapter); ++void et131x_handle_send_interrupt(struct et131x_adapter *adapter); ++void et131x_free_busy_send_packets(struct et131x_adapter *adapter); ++int et131x_send_packets(struct sk_buff *skb, struct net_device *netdev); ++ +--- a/drivers/staging/et131x/et131x_initpci.c ++++ b/drivers/staging/et131x/et131x_initpci.c +@@ -87,20 +87,16 @@ + #include <linux/random.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" + + #include "et131x_adapter.h" +-#include "et131x_netdev.h" +-#include "et131x_config.h" +-#include "et131x_isr.h" + + #include "et1310_address_map.h" + #include "et1310_tx.h" + #include "et1310_rx.h" +-#include "et1310_mac.h" +-#include "et1310_eeprom.h" ++#include "et131x.h" + ++#define INTERNAL_MEM_SIZE 0x400 /* 1024 of internal memory */ ++#define INTERNAL_MEM_RX_OFFSET 0x1FF /* 50% Tx, 50% Rx */ + + /* Defines for Parameter Default/Min/Max vaules */ + #define PARM_SPEED_DUPLEX_MIN 0 +--- a/drivers/staging/et131x/et131x_initpci.h ++++ /dev/null +@@ -1,73 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et131x_initpci.h - Header which includes common data and function prototypes +- * related to the driver's PCI (and PCI Express) information. +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET131X_INITPCI_H__ +-#define __ET131X_INITPCI_H__ +- +-/* Function Prototypes */ +-void et131x_align_allocated_memory(struct et131x_adapter *adapter, +- u64 *phys_addr, +- u64 *offset, u64 mask); +- +-int et131x_adapter_setup(struct et131x_adapter *adapter); +-int et131x_adapter_memory_alloc(struct et131x_adapter *adapter); +-void et131x_adapter_memory_free(struct et131x_adapter *adapter); +-void et131x_hwaddr_init(struct et131x_adapter *adapter); +-void et131x_soft_reset(struct et131x_adapter *adapter); +- +-#endif /* __ET131X_INITPCI_H__ */ +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -85,11 +85,27 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +-#include "et1310_mac.h" +- + #include "et131x_adapter.h" ++#include "et131x.h" ++ ++/* ++ * For interrupts, normal running is: ++ * rxdma_xfr_done, phy_interrupt, mac_stat_interrupt, ++ * watchdog_interrupt & txdma_xfer_done ++ * ++ * In both cases, when flow control is enabled for either Tx or bi-direction, ++ * we additional enable rx_fbr0_low and rx_fbr1_low, so we know when the ++ * buffer rings are running low. ++ */ ++#define INT_MASK_DISABLE 0xffffffff ++ ++/* NOTE: Masking out MAC_STAT Interrupt for now... ++ * #define INT_MASK_ENABLE 0xfff6bf17 ++ * #define INT_MASK_ENABLE_NO_FLOW 0xfff6bfd7 ++ */ ++#define INT_MASK_ENABLE 0xfffebf17 ++#define INT_MASK_ENABLE_NO_FLOW 0xfffebfd7 ++ + + /** + * et131x_enable_interrupts - enable interrupt +--- a/drivers/staging/et131x/et131x_isr.h ++++ /dev/null +@@ -1,65 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et131x_isr.h - Defines, structs, enums, prototypes, etc. pertaining to the +- * ISR processing code. +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET131X_ISR_H__ +-#define __ET131X_ISR_H__ +- +-irqreturn_t et131x_isr(int irq, void *dev_id); +-void et131x_isr_handler(struct work_struct *work); +- +-#endif /* __ET131X_ISR_H__ */ +--- a/drivers/staging/et131x/et131x_netdev.c ++++ b/drivers/staging/et131x/et131x_netdev.c +@@ -85,14 +85,9 @@ + #include <linux/ioport.h> + + #include "et1310_phy.h" +-#include "et1310_pm.h" +-#include "et1310_jagcore.h" +-#include "et1310_mac.h" + #include "et1310_tx.h" +- + #include "et131x_adapter.h" +-#include "et131x_isr.h" +-#include "et131x_initpci.h" ++#include "et131x.h" + + struct net_device_stats *et131x_stats(struct net_device *netdev); + int et131x_open(struct net_device *netdev); +--- a/drivers/staging/et131x/et131x_netdev.h ++++ /dev/null +@@ -1,64 +0,0 @@ +-/* +- * Agere Systems Inc. +- * 10/100/1000 Base-T Ethernet Driver for the ET1301 and ET131x series MACs +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * http://www.agere.com +- * +- *------------------------------------------------------------------------------ +- * +- * et131x_netdev.h - Defines, structs, enums, prototypes, etc. related to the +- * driver's net_device support. +- * +- *------------------------------------------------------------------------------ +- * +- * SOFTWARE LICENSE +- * +- * This software is provided subject to the following terms and conditions, +- * which you should read carefully before using the software. Using this +- * software indicates your acceptance of these terms and conditions. If you do +- * not agree with these terms and conditions, do not use the software. +- * +- * Copyright © 2005 Agere Systems Inc. +- * All rights reserved. +- * +- * Redistribution and use in source or binary forms, with or without +- * modifications, are permitted provided that the following conditions are met: +- * +- * . Redistributions of source code must retain the above copyright notice, this +- * list of conditions and the following Disclaimer as comments in the code as +- * well as in the documentation and/or other materials provided with the +- * distribution. +- * +- * . Redistributions in binary form must reproduce the above copyright notice, +- * this list of conditions and the following Disclaimer in the documentation +- * and/or other materials provided with the distribution. +- * +- * . Neither the name of Agere Systems Inc. nor the names of the contributors +- * may be used to endorse or promote products derived from this software +- * without specific prior written permission. +- * +- * Disclaimer +- * +- * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +- * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF +- * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ANY +- * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN +- * RISK. IN NO EVENT SHALL AGERE SYSTEMS INC. 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, INCLUDING, BUT NOT LIMITED TO, 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. +- * +- */ +- +-#ifndef __ET131X_NETDEV_H__ +-#define __ET131X_NETDEV_H__ +- +-struct net_device *et131x_device_alloc(void); +- +-#endif /* __ET131X_NETDEV_H__ */ +--- a/drivers/staging/et131x/et131x_version.h ++++ b/drivers/staging/et131x/et131x_version.h +@@ -62,20 +62,13 @@ + #define DRIVER_LICENSE "Dual BSD/GPL" + #define DRIVER_DEVICE_STRING "ET1310" + #define DRIVER_NAME "et131x" +-#define DRIVER_MAJOR_VERSION 1 +-#define DRIVER_MINOR_VERSION 2 +-#define DRIVER_PATCH_VERSION 3 +-#define DRIVER_VERSION_STRING "1.2.3" ++#define DRIVER_VERSION_STRING "1.2.3-lk" + #define DRIVER_VENDOR "Agere Systems, http://www.agere.com" + #define DRIVER_DESC "10/100/1000 Base-T Ethernet Driver" + +-#define STRUCT_MODULE "net" /* blux: missed by the kernel */ +- + #define DRIVER_INFO DRIVER_DESC " for the "\ + DRIVER_DEVICE_STRING ", v" \ + DRIVER_VERSION_STRING " by " \ + DRIVER_VENDOR + +-#define DRIVER_NAME_EXT "et131x.ko" +- + #endif /* __ET131X_VERSION_H__ */ diff --git a/staging/staging-et131x-fbr_desc-is-now-only-sane-types.patch b/staging/staging-et131x-fbr_desc-is-now-only-sane-types.patch new file mode 100644 index 00000000000000..60238d4bd1d5be --- /dev/null +++ b/staging/staging-et131x-fbr_desc-is-now-only-sane-types.patch @@ -0,0 +1,136 @@ +From alan@linux.intel.com Wed Jan 27 15:38:36 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:32:50 +0000 +Subject: Staging: et131x: fbr_desc is now only sane types +To: greg@kroah.com +Message-ID: <20100118153250.6884.9179.stgit@localhost.localdomain> + + +Clean up the typdef for fbr_desc itself so we know it is done + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 35 +++++++++++++++++------------------ + drivers/staging/et131x/et1310_rx.h | 5 +++-- + 2 files changed, 20 insertions(+), 20 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -170,7 +170,7 @@ int et131x_rx_dma_memory_alloc(struct et + #endif + + /* Allocate an area of memory for Free Buffer Ring 1 */ +- bufsize = (sizeof(FBR_DESC_t) * rx_ring->Fbr1NumEntries) + 0xfff; ++ bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr1NumEntries) + 0xfff; + rx_ring->pFbr1RingVa = pci_alloc_consistent(adapter->pdev, + bufsize, + &rx_ring->pFbr1RingPa); +@@ -199,7 +199,7 @@ int et131x_rx_dma_memory_alloc(struct et + + #ifdef USE_FBR0 + /* Allocate an area of memory for Free Buffer Ring 0 */ +- bufsize = (sizeof(FBR_DESC_t) * rx_ring->Fbr0NumEntries) + 0xfff; ++ bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr0NumEntries) + 0xfff; + rx_ring->pFbr0RingVa = pci_alloc_consistent(adapter->pdev, + bufsize, + &rx_ring->pFbr0RingPa); +@@ -450,12 +450,11 @@ void et131x_rx_dma_memory_free(struct et + rx_ring->pFbr1RingVa = (void *)((uint8_t *) + rx_ring->pFbr1RingVa - rx_ring->Fbr1offset); + +- bufsize = +- (sizeof(FBR_DESC_t) * rx_ring->Fbr1NumEntries) + 0xfff; ++ bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr1NumEntries) ++ + 0xfff; + +- pci_free_consistent(adapter->pdev, +- bufsize, +- rx_ring->pFbr1RingVa, rx_ring->pFbr1RingPa); ++ pci_free_consistent(adapter->pdev, bufsize, ++ rx_ring->pFbr1RingVa, rx_ring->pFbr1RingPa); + + rx_ring->pFbr1RingVa = NULL; + } +@@ -484,8 +483,8 @@ void et131x_rx_dma_memory_free(struct et + rx_ring->pFbr0RingVa = (void *)((uint8_t *) + rx_ring->pFbr0RingVa - rx_ring->Fbr0offset); + +- bufsize = +- (sizeof(FBR_DESC_t) * rx_ring->Fbr0NumEntries) + 0xfff; ++ bufsize = (sizeof(struct fbr_desc) * rx_ring->Fbr0NumEntries) ++ + 0xfff; + + pci_free_consistent(adapter->pdev, + bufsize, +@@ -596,7 +595,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + { + struct _RXDMA_t __iomem *rx_dma = &etdev->regs->rxdma; + struct _rx_ring_t *rx_local = &etdev->RxRing; +- PFBR_DESC_t fbr_entry; ++ struct fbr_desc *fbr_entry; + u32 entry; + u32 psr_num_des; + unsigned long flags; +@@ -636,7 +635,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + rx_local->local_psr_full = 0; + + /* Now's the best time to initialize FBR1 contents */ +- fbr_entry = (PFBR_DESC_t) rx_local->pFbr1RingVa; ++ fbr_entry = (struct fbr_desc *) rx_local->pFbr1RingVa; + for (entry = 0; entry < rx_local->Fbr1NumEntries; entry++) { + fbr_entry->addr_hi = rx_local->Fbr[1]->PAHigh[entry]; + fbr_entry->addr_lo = rx_local->Fbr[1]->PALow[entry]; +@@ -661,7 +660,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + + #ifdef USE_FBR0 + /* Now's the best time to initialize FBR0 contents */ +- fbr_entry = (PFBR_DESC_t) rx_local->pFbr0RingVa; ++ fbr_entry = (struct fbr_desc *) rx_local->pFbr0RingVa; + for (entry = 0; entry < rx_local->Fbr0NumEntries; entry++) { + fbr_entry->addr_hi = rx_local->Fbr[0]->PAHigh[entry]; + fbr_entry->addr_lo = rx_local->Fbr[0]->PALow[entry]; +@@ -1116,9 +1115,9 @@ void nic_return_rfd(struct et131x_adapte + spin_lock_irqsave(&etdev->FbrLock, flags); + + if (ri == 1) { +- PFBR_DESC_t next = +- (PFBR_DESC_t) (rx_local->pFbr1RingVa) + +- INDEX10(rx_local->local_Fbr1_full); ++ struct fbr_desc *next = ++ (struct fbr_desc *) (rx_local->pFbr1RingVa) + ++ INDEX10(rx_local->local_Fbr1_full); + + /* Handle the Free Buffer Ring advancement here. Write + * the PA / Buffer Index for the returned buffer into +@@ -1134,9 +1133,9 @@ void nic_return_rfd(struct et131x_adapte + } + #ifdef USE_FBR0 + else { +- PFBR_DESC_t next = +- (PFBR_DESC_t) rx_local->pFbr0RingVa + +- INDEX10(rx_local->local_Fbr0_full); ++ struct fbr_desc *next = (struct fbr_desc *) ++ rx_local->pFbr0RingVa + ++ INDEX10(rx_local->local_Fbr0_full); + + /* Handle the Free Buffer Ring advancement here. Write + * the PA / Buffer Index for the returned buffer into +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -91,11 +91,12 @@ + #define ALCATEL_BROADCAST_PKT 0x02000000 + + /* typedefs for Free Buffer Descriptors */ +-typedef struct _FBR_DESC_t { ++struct fbr_desc ++{ + u32 addr_lo; + u32 addr_hi; + u32 word2; /* Bits 10-31 reserved, 0-9 descriptor */ +-} FBR_DESC_t, *PFBR_DESC_t; ++}; + + /* Typedefs for Packet Status Ring Descriptors */ + typedef union _PKT_STAT_DESC_WORD0_t { diff --git a/staging/staging-et131x-fix-rx_status-typing.patch b/staging/staging-et131x-fix-rx_status-typing.patch new file mode 100644 index 00000000000000..c6a4fbd2cd40a7 --- /dev/null +++ b/staging/staging-et131x-fix-rx_status-typing.patch @@ -0,0 +1,90 @@ +From alan@linux.intel.com Wed Jan 27 15:43:31 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:51 +0000 +Subject: Staging: et131x: Fix rx_status typing +To: greg@kroah.com +Message-ID: <20100118153350.6884.8356.stgit@localhost.localdomain> + + +Use the proper pointer types for the higher level pointers to the rx_status +object and kill casts + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 21 ++++++++++----------- + drivers/staging/et131x/et1310_rx.h | 4 ++-- + 2 files changed, 12 insertions(+), 13 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -360,16 +360,16 @@ int et131x_rx_dma_memory_alloc(struct et + */ + + /* Allocate an area of memory for writeback of status information */ +- rx_ring->pRxStatusVa = pci_alloc_consistent(adapter->pdev, ++ rx_ring->rx_status_block = pci_alloc_consistent(adapter->pdev, + sizeof(struct rx_status_block), +- &rx_ring->pRxStatusPa); +- if (!rx_ring->pRxStatusVa) { ++ &rx_ring->rx_status_bus); ++ if (!rx_ring->rx_status_block) { + dev_err(&adapter->pdev->dev, + "Cannot alloc memory for Status Block\n"); + return -ENOMEM; + } + rx_ring->NumRfd = NIC_DEFAULT_NUM_RFD; +- printk("PRS %lx\n", (unsigned long)rx_ring->pRxStatusPa); ++ printk("PRS %lx\n", (unsigned long)rx_ring->rx_status_bus); + + /* Recv + * pci_pool_create initializes a lookaside list. After successful +@@ -506,12 +506,11 @@ void et131x_rx_dma_memory_free(struct et + } + + /* Free area of memory for the writeback of status information */ +- if (rx_ring->pRxStatusVa) { ++ if (rx_ring->rx_status_block) { + pci_free_consistent(adapter->pdev, +- sizeof(struct rx_status_block), +- rx_ring->pRxStatusVa, rx_ring->pRxStatusPa); +- +- rx_ring->pRxStatusVa = NULL; ++ sizeof(struct rx_status_block), ++ rx_ring->rx_status_block, rx_ring->rx_status_bus); ++ rx_ring->rx_status_block = NULL; + } + + /* Free receive buffer pool */ +@@ -614,7 +613,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + &rx_dma->dma_wb_base_hi); + writel((u32) rx_local->pRxStatusPa, &rx_dma->dma_wb_base_lo); + +- memset(rx_local->pRxStatusVa, 0, sizeof(struct rx_status_block)); ++ memset(rx_local->rx_status_block, 0, sizeof(struct rx_status_block)); + + /* Set the address and parameters of the packet status ring into the + * 1310's registers +@@ -803,7 +802,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + * interrupt. It contains the next to be used entry in the Packet + * Status Ring, and also the two Free Buffer rings. + */ +- status = (struct rx_status_block *)rx_local->pRxStatusVa; ++ status = rx_local->rx_status_block; + word1 = status->Word1 >> 16; /* Get the useful bits */ + + /* Check the PSR and wrap bits do not match */ +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -270,8 +270,8 @@ typedef struct _rx_ring_t { + u32 local_psr_full; + u32 PsrNumEntries; + +- void *pRxStatusVa; +- dma_addr_t pRxStatusPa; ++ struct rx_status_block *rx_status_block; ++ dma_addr_t rx_status_bus; + + struct list_head RecvBufferPool; + diff --git a/staging/staging-et131x-global_t-is-now-sane-so-kill-the-global_t-itself.patch b/staging/staging-et131x-global_t-is-now-sane-so-kill-the-global_t-itself.patch new file mode 100644 index 00000000000000..115dd86902c998 --- /dev/null +++ b/staging/staging-et131x-global_t-is-now-sane-so-kill-the-global_t-itself.patch @@ -0,0 +1,61 @@ +From alan@linux.intel.com Wed Jan 27 15:40:01 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:12 +0000 +Subject: Staging: et131x: GLOBAL_t is now sane so kill the GLOBAL_t itself +To: greg@kroah.com +Message-ID: <20100118153312.6884.92323.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 10 ++++------ + drivers/staging/et131x/et131x_initpci.c | 2 +- + 2 files changed, 5 insertions(+), 7 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -149,7 +149,7 @@ + * GLOBAL Module of JAGCore Address Mapping + * Located at address 0x0000 + */ +-typedef struct _GLOBAL_t { /* Location: */ ++struct global_regs { /* Location: */ + u32 txq_start_addr; /* 0x0000 */ + u32 txq_end_addr; /* 0x0004 */ + u32 rxq_start_addr; /* 0x0008 */ +@@ -165,9 +165,7 @@ typedef struct _GLOBAL_t { /* Location + u32 msi_config; /* 0x0030 */ + u32 loopback; /* 0x0034 */ + u32 watchdog_timer; /* 0x0038 */ +-} GLOBAL_t, *PGLOBAL_t; +- +-/* END OF GLOBAL REGISTER ADDRESS MAP */ ++}; + + + /* START OF TXDMA REGISTER ADDRESS MAP */ +@@ -1666,9 +1664,9 @@ typedef struct _MMC_t { /* Location: * + * JAGCore Address Mapping + */ + typedef struct _ADDRESS_MAP_t { +- GLOBAL_t global; ++ struct global_regs global; + /* unused section of global address map */ +- u8 unused_global[4096 - sizeof(GLOBAL_t)]; ++ u8 unused_global[4096 - sizeof(struct global_regs)]; + TXDMA_t txdma; + /* unused section of txdma address map */ + u8 unused_txdma[4096 - sizeof(TXDMA_t)]; +--- a/drivers/staging/et131x/et131x_initpci.c ++++ b/drivers/staging/et131x/et131x_initpci.c +@@ -327,7 +327,7 @@ void et131x_link_detection_handler(unsig + */ + void ConfigGlobalRegs(struct et131x_adapter *etdev) + { +- struct _GLOBAL_t __iomem *regs = &etdev->regs->global; ++ struct global_regs __iomem *regs = &etdev->regs->global; + + writel(0, ®s->rxq_start_addr); + writel(INTERNAL_MEM_SIZE - 1, ®s->txq_end_addr); diff --git a/staging/staging-et131x-kil-the-txmac-type.patch b/staging/staging-et131x-kil-the-txmac-type.patch new file mode 100644 index 00000000000000..d151f55f53e342 --- /dev/null +++ b/staging/staging-et131x-kil-the-txmac-type.patch @@ -0,0 +1,100 @@ +From alan@linux.intel.com Wed Jan 27 15:44:32 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:29 +0000 +Subject: Staging: et131x: Kil the txmac type +To: greg@kroah.com +Message-ID: <20100118153429.6884.26767.stgit@localhost.localdomain> + + +Only used for one trivial thing so turn that into something trivial instead + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 39 ++++++++-------------------- + drivers/staging/et131x/et1310_mac.c | 9 ++---- + 2 files changed, 16 insertions(+), 32 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -538,33 +538,18 @@ struct rxdma_regs { /* Location: */ + /* + * structure for control reg in txmac address map + * located at address 0x3000 ++ * ++ * bits ++ * 31-8: unused ++ * 7: cklseg_disable ++ * 6: ckbcnt_disable ++ * 5: cksegnum ++ * 4: async_disable ++ * 3: fc_disable ++ * 2: mcif_disable ++ * 1: mif_disable ++ * 0: txmac_en + */ +-typedef union _TXMAC_CTL_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused:24; /* bits 8-31 */ +- u32 cklseg_diable:1; /* bit 7 */ +- u32 ckbcnt_disable:1; /* bit 6 */ +- u32 cksegnum:1; /* bit 5 */ +- u32 async_disable:1; /* bit 4 */ +- u32 fc_disable:1; /* bit 3 */ +- u32 mcif_disable:1; /* bit 2 */ +- u32 mif_disable:1; /* bit 1 */ +- u32 txmac_en:1; /* bit 0 */ +-#else +- u32 txmac_en:1; /* bit 0 */ +- u32 mif_disable:1; /* bit 1 mac interface */ +- u32 mcif_disable:1; /* bit 2 mem. contr. interface */ +- u32 fc_disable:1; /* bit 3 */ +- u32 async_disable:1; /* bit 4 */ +- u32 cksegnum:1; /* bit 5 */ +- u32 ckbcnt_disable:1; /* bit 6 */ +- u32 cklseg_diable:1; /* bit 7 */ +- u32 unused:24; /* bits 8-31 */ +-#endif +- } bits; +-} TXMAC_CTL_t, *PTXMAC_CTL_t; + + /* + * structure for shadow pointer reg in txmac address map +@@ -695,7 +680,7 @@ typedef union _TXMAC_ERR_INT_t { + * Tx MAC Module of JAGCore Address Mapping + */ + typedef struct _TXMAC_t { /* Location: */ +- TXMAC_CTL_t ctl; /* 0x3000 */ ++ u32 ctl; /* 0x3000 */ + u32 shadow_ptr; /* 0x3004 */ + TXMAC_ERR_CNT_t err_cnt; /* 0x3008 */ + u32 max_fill; /* 0x300C */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -170,9 +170,9 @@ void ConfigMACRegs2(struct et131x_adapte + u32 cfg1; + u32 cfg2; + u32 ifctrl; +- TXMAC_CTL_t ctl; ++ u32 ctl; + +- ctl.value = readl(&etdev->regs->txmac.ctl.value); ++ ctl = readl(&etdev->regs->txmac.ctl); + cfg1 = readl(&pMac->cfg1); + cfg2 = readl(&pMac->cfg2); + ifctrl = readl(&pMac->if_ctrl); +@@ -226,9 +226,8 @@ void ConfigMACRegs2(struct et131x_adapte + } + + /* Enable TXMAC */ +- ctl.bits.txmac_en = 0x1; +- ctl.bits.fc_disable = 0x1; +- writel(ctl.value, &etdev->regs->txmac.ctl.value); ++ ctl |= 0x05; /* TX mac enable, FC disable */ ++ writel(ctl, &etdev->regs->txmac.ctl); + + /* Ready to start the RXDMA/TXDMA engine */ + if (etdev->Flags & fMP_ADAPTER_LOWER_POWER) { diff --git a/staging/staging-et131x-kill-exp_rom.patch b/staging/staging-et131x-kill-exp_rom.patch new file mode 100644 index 00000000000000..a38d897b5d90ab --- /dev/null +++ b/staging/staging-et131x-kill-exp_rom.patch @@ -0,0 +1,55 @@ +From alan@linux.intel.com Wed Jan 27 15:39:42 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:07 +0000 +Subject: Staging: et131x: kill EXP_ROM +To: greg@kroah.com +Message-ID: <20100118153306.6884.80999.stgit@localhost.localdomain> + + +This is another unused type for the bin + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + + drivers/staging/et131x/et1310_address_map.h | 21 --------------------- + 1 file changed, 21 deletions(-) + + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -1662,22 +1662,6 @@ typedef struct _MMC_t { /* Location: * + /* END OF MMC REGISTER ADDRESS MAP */ + + +-/* START OF EXP ROM REGISTER ADDRESS MAP */ +- +-/* +- * Expansion ROM Module of JAGCore Address Mapping +- */ +- +-/* Take this out until it is not empty */ +-#if 0 +-typedef struct _EXP_ROM_t { +- +-} EXP_ROM_t, *PEXP_ROM_t; +-#endif +- +-/* END OF EXP ROM REGISTER ADDRESS MAP */ +- +- + /* + * JAGCore Address Mapping + */ +@@ -1709,11 +1693,6 @@ typedef struct _ADDRESS_MAP_t { + /* unused section of address map */ + u8 unused_[1015808]; + +-/* Take this out until it is not empty */ +-#if 0 +- EXP_ROM_t exp_rom; +-#endif +- + u8 unused_exp_rom[4096]; /* MGS-size TBD */ + u8 unused__[524288]; /* unused section of address map */ + } ADDRESS_MAP_t, *PADDRESS_MAP_t; diff --git a/staging/staging-et131x-kill-mac_stat_t.patch b/staging/staging-et131x-kill-mac_stat_t.patch new file mode 100644 index 00000000000000..d698b03e58d468 --- /dev/null +++ b/staging/staging-et131x-kill-mac_stat_t.patch @@ -0,0 +1,95 @@ +From alan@linux.intel.com Wed Jan 27 15:40:19 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:29 +0000 +Subject: Staging: et131x: Kill MAC_STAT_t +To: greg@kroah.com +Message-ID: <20100118153328.6884.94936.stgit@localhost.localdomain> + + +All the contents of this type are now clean, so kill the top level type +as well + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + + drivers/staging/et131x/et1310_address_map.h | 11 ++++++----- + drivers/staging/et131x/et1310_mac.c | 16 ++++++++-------- + 2 files changed, 14 insertions(+), 13 deletions(-) + + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -1464,8 +1464,9 @@ typedef struct _MAC_t { /* Location: + /* + * MAC STATS Module of JAGCore Address Mapping + */ +-typedef struct _MAC_STAT_t { /* Location: */ +- u32 pad[32]; /* 0x6000 - 607C */ ++struct macstat_regs ++{ /* Location: */ ++ u32 pad[32]; /* 0x6000 - 607C */ + + /* Tx/Rx 0-64 Byte Frame Counter */ + u32 TR64; /* 0x6080 */ +@@ -1610,7 +1611,7 @@ typedef struct _MAC_STAT_t { /* Locatio + + /* Carry Register Two Mask Register */ + u32 Carry2M; /* 0x613C */ +-} MAC_STAT_t, *PMAC_STAT_t; ++}; + + /* END OF MAC STAT REGISTER ADDRESS MAP */ + +@@ -1682,9 +1683,9 @@ typedef struct _ADDRESS_MAP_t { + MAC_t mac; + /* unused section of mac address map */ + u8 unused_mac[4096 - sizeof(MAC_t)]; +- MAC_STAT_t macStat; ++ struct macstat_regs macstat; + /* unused section of mac stat address map */ +- u8 unused_mac_stat[4096 - sizeof(MAC_STAT_t)]; ++ u8 unused_mac_stat[4096 - sizeof(struct macstat_regs)]; + struct mmc_regs mmc; + /* unused section of mmc address map */ + u8 unused_mmc[4096 - sizeof(struct mmc_regs)]; +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -384,8 +384,8 @@ void ConfigTxMacRegs(struct et131x_adapt + + void ConfigMacStatRegs(struct et131x_adapter *etdev) + { +- struct _MAC_STAT_t __iomem *macstat = +- &etdev->regs->macStat; ++ struct macstat_regs __iomem *macstat = ++ &etdev->regs->macstat; + + /* Next we need to initialize all the MAC_STAT registers to zero on + * the device. +@@ -456,8 +456,8 @@ void ConfigFlowControl(struct et131x_ada + void UpdateMacStatHostCounters(struct et131x_adapter *etdev) + { + struct _ce_stats_t *stats = &etdev->Stats; +- struct _MAC_STAT_t __iomem *macstat = +- &etdev->regs->macStat; ++ struct macstat_regs __iomem *macstat = ++ &etdev->regs->macstat; + + stats->collisions += readl(&macstat->TNcl); + stats->first_collision += readl(&macstat->TScl); +@@ -493,11 +493,11 @@ void HandleMacStatInterrupt(struct et131 + /* Read the interrupt bits from the register(s). These are Clear On + * Write. + */ +- Carry1 = readl(&etdev->regs->macStat.Carry1); +- Carry2 = readl(&etdev->regs->macStat.Carry2); ++ Carry1 = readl(&etdev->regs->macstat.Carry1); ++ Carry2 = readl(&etdev->regs->macstat.Carry2); + +- writel(Carry1, &etdev->regs->macStat.Carry1); +- writel(Carry2, &etdev->regs->macStat.Carry2); ++ writel(Carry1, &etdev->regs->macstat.Carry1); ++ writel(Carry2, &etdev->regs->macstat.Carry2); + + /* We need to do update the host copy of all the MAC_STAT counters. + * For each counter, check it's overflow bit. If the overflow bit is diff --git a/staging/staging-et131x-kill-mif_ctl_t.patch b/staging/staging-et131x-kill-mif_ctl_t.patch new file mode 100644 index 00000000000000..5382b376b4cbc1 --- /dev/null +++ b/staging/staging-et131x-kill-mif_ctl_t.patch @@ -0,0 +1,76 @@ +From alan@linux.intel.com Wed Jan 27 15:45:45 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:19 +0000 +Subject: Staging: et131x: Kill MIF_CTL_t +To: greg@kroah.com +Message-ID: <20100118153519.6884.87277.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 20 +++++--------------- + drivers/staging/et131x/et1310_mac.c | 6 +++--- + 2 files changed, 8 insertions(+), 18 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -883,21 +883,11 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for management interface reg in rxmac address map. + * located at address 0x4098 ++ * ++ * 31-18: reserved ++ * 17: drop_pkt_en ++ * 16-0: drop_pkt_mask + */ +-typedef union _RXMAC_MIF_CTL_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserve:14; /* bits 18-31 */ +- u32 drop_pkt_en:1; /* bit 17 */ +- u32 drop_pkt_mask:17; /* bits 0-16 */ +-#else +- u32 drop_pkt_mask:17; /* bits 0-16 */ +- u32 drop_pkt_en:1; /* bit 17 */ +- u32 reserve:14; /* bits 18-31 */ +-#endif +- } bits; +-} RXMAC_MIF_CTL_t, *PRXMAC_MIF_CTL_t; + + /* + * structure for Error reg in rxmac address map. +@@ -965,7 +955,7 @@ typedef struct _RXMAC_t { /* Location + u32 rxq_diag; /* 0x4090 */ + u32 space_avail; /* 0x4094 */ + +- RXMAC_MIF_CTL_t mif_ctrl; /* 0x4098 */ ++ u32 mif_ctrl; /* 0x4098 */ + RXMAC_ERROR_REG_t err_reg; /* 0x409C */ + } RXMAC_t, *PRXMAC_t; + +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -333,7 +333,7 @@ void ConfigRxMacRegs(struct et131x_adapt + writel(0, &pRxMac->mcif_water_mark); + + /* Initialize the MIF control */ +- writel(0, &pRxMac->mif_ctrl.value); ++ writel(0, &pRxMac->mif_ctrl); + + /* Initialize the Space Available Register */ + writel(0, &pRxMac->space_avail); +@@ -352,9 +352,9 @@ void ConfigRxMacRegs(struct et131x_adapt + * bit 17: Drop packet enable + */ + if (etdev->linkspeed == TRUEPHY_SPEED_100MBPS) +- writel(0x30038, &pRxMac->mif_ctrl.value); ++ writel(0x30038, &pRxMac->mif_ctrl); + else +- writel(0x30030, &pRxMac->mif_ctrl.value); ++ writel(0x30030, &pRxMac->mif_ctrl); + + /* Finally we initialize RxMac to be enabled & WOL disabled. Packet + * filter is always enabled since it is where the runt packets are diff --git a/staging/staging-et131x-kill-mp_err_counters-which-is-unused.patch b/staging/staging-et131x-kill-mp_err_counters-which-is-unused.patch new file mode 100644 index 00000000000000..b3d1a32e7d9732 --- /dev/null +++ b/staging/staging-et131x-kill-mp_err_counters-which-is-unused.patch @@ -0,0 +1,33 @@ +From alan@linux.intel.com Wed Jan 27 15:44:00 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:13 +0000 +Subject: Staging: et131x: kill MP_ERR_COUNTERS which is unused +To: greg@kroah.com +Message-ID: <20100118153413.6884.75089.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et131x_adapter.h | 9 --------- + 1 file changed, 9 deletions(-) + +--- a/drivers/staging/et131x/et131x_adapter.h ++++ b/drivers/staging/et131x/et131x_adapter.h +@@ -100,15 +100,6 @@ + #define LO_MARK_PERCENT_FOR_PSR 15 + #define LO_MARK_PERCENT_FOR_RX 15 + +-/* Counters for error rate monitoring */ +-typedef struct _MP_ERR_COUNTERS { +- u32 PktCountTxPackets; +- u32 PktCountTxErrors; +- u32 TimerBasedTxErrors; +- u32 PktCountLastError; +- u32 ErredConsecPackets; +-} MP_ERR_COUNTERS, *PMP_ERR_COUNTERS; +- + /* RFD (Receive Frame Descriptor) */ + typedef struct _MP_RFD { + struct list_head list_node; diff --git a/staging/staging-et131x-kill-of-fbr_word2.patch b/staging/staging-et131x-kill-of-fbr_word2.patch new file mode 100644 index 00000000000000..ef58d84698848e --- /dev/null +++ b/staging/staging-et131x-kill-of-fbr_word2.patch @@ -0,0 +1,84 @@ +From alan@linux.intel.com Wed Jan 27 15:38:21 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:32:44 +0000 +Subject: Staging: et131x: kill of FBR_WORD2 +To: greg@kroah.com +Message-ID: <20100118153244.6884.12955.stgit@localhost.localdomain> + + +This is only used meaningfully as a definition, we never mask and fetch the +bits apart + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 8 ++++---- + drivers/staging/et131x/et1310_rx.h | 15 +-------------- + 2 files changed, 5 insertions(+), 18 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -640,7 +640,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + for (entry = 0; entry < rx_local->Fbr1NumEntries; entry++) { + fbr_entry->addr_hi = rx_local->Fbr[1]->PAHigh[entry]; + fbr_entry->addr_lo = rx_local->Fbr[1]->PALow[entry]; +- fbr_entry->word2.bits.bi = entry; ++ fbr_entry->word2 = entry; + fbr_entry++; + } + +@@ -665,7 +665,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + for (entry = 0; entry < rx_local->Fbr0NumEntries; entry++) { + fbr_entry->addr_hi = rx_local->Fbr[0]->PAHigh[entry]; + fbr_entry->addr_lo = rx_local->Fbr[0]->PALow[entry]; +- fbr_entry->word2.bits.bi = entry; ++ fbr_entry->word2 = entry; + fbr_entry++; + } + +@@ -1126,7 +1126,7 @@ void nic_return_rfd(struct et131x_adapte + */ + next->addr_hi = rx_local->Fbr[1]->PAHigh[bi]; + next->addr_lo = rx_local->Fbr[1]->PALow[bi]; +- next->word2.value = bi; ++ next->word2 = bi; + + writel(bump_fbr(&rx_local->local_Fbr1_full, + rx_local->Fbr1NumEntries - 1), +@@ -1144,7 +1144,7 @@ void nic_return_rfd(struct et131x_adapte + */ + next->addr_hi = rx_local->Fbr[0]->PAHigh[bi]; + next->addr_lo = rx_local->Fbr[0]->PALow[bi]; +- next->word2.value = bi; ++ next->word2 = bi; + + writel(bump_fbr(&rx_local->local_Fbr0_full, + rx_local->Fbr0NumEntries - 1), +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -91,23 +91,10 @@ + #define ALCATEL_BROADCAST_PKT 0x02000000 + + /* typedefs for Free Buffer Descriptors */ +-typedef union _FBR_WORD2_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved:22; /* bits 10-31 */ +- u32 bi:10; /* bits 0-9(Buffer Index) */ +-#else +- u32 bi:10; /* bits 0-9(Buffer Index) */ +- u32 reserved:22; /* bit 10-31 */ +-#endif +- } bits; +-} FBR_WORD2_t, *PFBR_WORD2_t; +- + typedef struct _FBR_DESC_t { + u32 addr_lo; + u32 addr_hi; +- FBR_WORD2_t word2; ++ u32 word2; /* Bits 10-31 reserved, 0-9 descriptor */ + } FBR_DESC_t, *PFBR_DESC_t; + + /* Typedefs for Packet Status Ring Descriptors */ diff --git a/staging/staging-et131x-kill-of-the-mcif-types.patch b/staging/staging-et131x-kill-of-the-mcif-types.patch new file mode 100644 index 00000000000000..92fa419c380f87 --- /dev/null +++ b/staging/staging-et131x-kill-of-the-mcif-types.patch @@ -0,0 +1,123 @@ +From alan@linux.intel.com Wed Jan 27 15:45:16 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:02 +0000 +Subject: Staging: et131x: Kill of the MCIF types +To: greg@kroah.com +Message-ID: <20100118153502.6884.10996.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 46 +++++++--------------------- + drivers/staging/et131x/et1310_mac.c | 20 ++++-------- + 2 files changed, 19 insertions(+), 47 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -843,44 +843,22 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for Memory Controller Interface Control Max Segment reg in rxmac + * address map. Located at address 0x4088 ++ * ++ * 31-10: reserved ++ * 9-2: max_size ++ * 1: fc_en ++ * 0: seg_en + */ +-typedef union _RXMAC_MCIF_CTRL_MAX_SEG_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved:22; /* bits 10-31 */ +- u32 max_size:8; /* bits 2-9 */ +- u32 fc_en:1; /* bit 1 */ +- u32 seg_en:1; /* bit 0 */ +-#else +- u32 seg_en:1; /* bit 0 */ +- u32 fc_en:1; /* bit 1 */ +- u32 max_size:8; /* bits 2-9 */ +- u32 reserved:22; /* bits 10-31 */ +-#endif +- } bits; +-} RXMAC_MCIF_CTRL_MAX_SEG_t, *PRXMAC_MCIF_CTRL_MAX_SEG_t; + + /* + * structure for Memory Controller Interface Water Mark reg in rxmac address + * map. Located at address 0x408C ++ * ++ * 31-26: unused ++ * 25-16: mark_hi ++ * 15-10: unused ++ * 9-0: mark_lo + */ +-typedef union _RXMAC_MCIF_WATER_MARK_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved2:6; /* bits 26-31 */ +- u32 mark_hi:10; /* bits 16-25 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 mark_lo:10; /* bits 0-9 */ +-#else +- u32 mark_lo:10; /* bits 0-9 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 mark_hi:10; /* bits 16-25 */ +- u32 reserved2:6; /* bits 26-31 */ +-#endif +- } bits; +-} RXMAC_MCIF_WATER_MARK_t, *PRXMAC_MCIF_WATER_MARK_t; + + /* + * structure for Rx Queue Dialog reg in rxmac address map. +@@ -1004,8 +982,8 @@ typedef struct _RXMAC_t { /* Location + u32 multi_hash3; /* 0x407C */ + u32 multi_hash4; /* 0x4080 */ + u32 pf_ctrl; /* 0x4084 */ +- RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg; /* 0x4088 */ +- RXMAC_MCIF_WATER_MARK_t mcif_water_mark; /* 0x408C */ ++ u32 mcif_ctrl_max_seg; /* 0x4088 */ ++ u32 mcif_water_mark; /* 0x408C */ + RXMAC_RXQ_DIAG_t rxq_diag; /* 0x4090 */ + RXMAC_SPACE_AVAIL_t space_avail; /* 0x4094 */ + +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -314,9 +314,7 @@ void ConfigRxMacRegs(struct et131x_adapt + pf_ctrl |= (NIC_MIN_PACKET_SIZE + 4) << 16; + pf_ctrl |= 8; /* Fragment filter */ + +- if (etdev->RegistryJumboPacket > 8192) { +- RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg; +- ++ if (etdev->RegistryJumboPacket > 8192) + /* In order to transmit jumbo packets greater than 8k, the + * FIFO between RxMAC and RxDMA needs to be reduced in size + * to (16k - Jumbo packet size). In order to implement this, +@@ -324,19 +322,15 @@ void ConfigRxMacRegs(struct et131x_adapt + * packets down into segments which are (max_size * 16). In + * this case we selected 256 bytes, since this is the size of + * the PCI-Express TLP's that the 1310 uses. ++ * ++ * seg_en on, fc_en off, size 0x10 + */ +- mcif_ctrl_max_seg.bits.seg_en = 0x1; +- mcif_ctrl_max_seg.bits.fc_en = 0x0; +- mcif_ctrl_max_seg.bits.max_size = 0x10; +- +- writel(mcif_ctrl_max_seg.value, +- &pRxMac->mcif_ctrl_max_seg.value); +- } else { +- writel(0, &pRxMac->mcif_ctrl_max_seg.value); +- } ++ writel(0x41, &pRxMac->mcif_ctrl_max_seg); ++ else ++ writel(0, &pRxMac->mcif_ctrl_max_seg); + + /* Initialize the MCIF water marks */ +- writel(0, &pRxMac->mcif_water_mark.value); ++ writel(0, &pRxMac->mcif_water_mark); + + /* Initialize the MIF control */ + writel(0, &pRxMac->mif_ctrl.value); diff --git a/staging/staging-et131x-kill-off-mmc_t.patch b/staging/staging-et131x-kill-off-mmc_t.patch new file mode 100644 index 00000000000000..6fd06fa905c309 --- /dev/null +++ b/staging/staging-et131x-kill-off-mmc_t.patch @@ -0,0 +1,48 @@ +From alan@linux.intel.com Wed Jan 27 15:42:34 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:23 +0000 +Subject: Staging: et131x: Kill off MMC_t +To: greg@kroah.com +Message-ID: <20100118153323.6884.97556.stgit@localhost.localdomain> + + +The contents of MMC_t are clean so kill off the MMC_t typedef + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -1648,14 +1648,14 @@ typedef struct _MAC_STAT_t { /* Locatio + /* + * Memory Control Module of JAGCore Address Mapping + */ +-typedef struct _MMC_t { /* Location: */ ++struct mmc_regs { /* Location: */ + u32 mmc_ctrl; /* 0x7000 */ + u32 sram_access; /* 0x7004 */ + u32 sram_word1; /* 0x7008 */ + u32 sram_word2; /* 0x700C */ + u32 sram_word3; /* 0x7010 */ + u32 sram_word4; /* 0x7014 */ +-} MMC_t, *PMMC_t; ++}; + + /* END OF MMC REGISTER ADDRESS MAP */ + +@@ -1685,9 +1685,9 @@ typedef struct _ADDRESS_MAP_t { + MAC_STAT_t macStat; + /* unused section of mac stat address map */ + u8 unused_mac_stat[4096 - sizeof(MAC_STAT_t)]; +- MMC_t mmc; ++ struct mmc_regs mmc; + /* unused section of mmc address map */ +- u8 unused_mmc[4096 - sizeof(MMC_t)]; ++ u8 unused_mmc[4096 - sizeof(struct mmc_regs)]; + /* unused section of address map */ + u8 unused_[1015808]; + diff --git a/staging/staging-et131x-kill-off-rx_ring_t.patch b/staging/staging-et131x-kill-off-rx_ring_t.patch new file mode 100644 index 00000000000000..8ef8a143f2daab --- /dev/null +++ b/staging/staging-et131x-kill-off-rx_ring_t.patch @@ -0,0 +1,247 @@ +From alan@linux.intel.com Wed Jan 27 15:43:53 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:07 +0000 +Subject: Staging: et131x: Kill off RX_RING_t +To: greg@kroah.com +Message-ID: <20100118153407.6884.50296.stgit@localhost.localdomain> + + +This completes the typedef clean up of the rx specific structures, although +there is plenty do on field names and the like + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 54 ++++++++++++++++---------------- + drivers/staging/et131x/et1310_rx.h | 8 ++-- + drivers/staging/et131x/et131x_adapter.h | 2 - + drivers/staging/et131x/et131x_isr.c | 2 - + 4 files changed, 33 insertions(+), 33 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -109,10 +109,10 @@ int et131x_rx_dma_memory_alloc(struct et + u32 i, j; + u32 bufsize; + u32 pktStatRingSize, FBRChunkSize; +- RX_RING_t *rx_ring; ++ struct rx_ring *rx_ring; + + /* Setup some convenience pointers */ +- rx_ring = (RX_RING_t *) &adapter->RxRing; ++ rx_ring = &adapter->rx_ring; + + /* Alloc memory for the lookup table */ + #ifdef USE_FBR0 +@@ -162,10 +162,10 @@ int et131x_rx_dma_memory_alloc(struct et + } + + #ifdef USE_FBR0 +- adapter->RxRing.PsrNumEntries = adapter->RxRing.Fbr0NumEntries + +- adapter->RxRing.Fbr1NumEntries; ++ adapter->rx_ring.PsrNumEntries = adapter->rx_ring.Fbr0NumEntries + ++ adapter->rx_ring.Fbr1NumEntries; + #else +- adapter->RxRing.PsrNumEntries = adapter->RxRing.Fbr1NumEntries; ++ adapter->rx_ring.PsrNumEntries = adapter->rx_ring.Fbr1NumEntries; + #endif + + /* Allocate an area of memory for Free Buffer Ring 1 */ +@@ -338,7 +338,7 @@ int et131x_rx_dma_memory_alloc(struct et + + /* Allocate an area of memory for FIFO of Packet Status ring entries */ + pktStatRingSize = +- sizeof(struct pkt_stat_desc) * adapter->RxRing.PsrNumEntries; ++ sizeof(struct pkt_stat_desc) * adapter->rx_ring.PsrNumEntries; + + rx_ring->pPSRingVa = pci_alloc_consistent(adapter->pdev, + pktStatRingSize, +@@ -402,10 +402,10 @@ void et131x_rx_dma_memory_free(struct et + u32 bufsize; + u32 pktStatRingSize; + PMP_RFD rfd; +- RX_RING_t *rx_ring; ++ struct rx_ring *rx_ring; + + /* Setup some convenience pointers */ +- rx_ring = (RX_RING_t *) &adapter->RxRing; ++ rx_ring = &adapter->rx_ring; + + /* Free RFDs and associated packet descriptors */ + WARN_ON(rx_ring->nReadyRecv != rx_ring->NumRfd); +@@ -416,7 +416,7 @@ void et131x_rx_dma_memory_free(struct et + + list_del(&rfd->list_node); + rfd->Packet = NULL; +- kmem_cache_free(adapter->RxRing.RecvLookaside, rfd); ++ kmem_cache_free(adapter->rx_ring.RecvLookaside, rfd); + } + + /* Free Free Buffer Ring 1 */ +@@ -496,7 +496,7 @@ void et131x_rx_dma_memory_free(struct et + /* Free Packet Status Ring */ + if (rx_ring->pPSRingVa) { + pktStatRingSize = +- sizeof(struct pkt_stat_desc) * adapter->RxRing.PsrNumEntries; ++ sizeof(struct pkt_stat_desc) * adapter->rx_ring.PsrNumEntries; + + pci_free_consistent(adapter->pdev, pktStatRingSize, + rx_ring->pPSRingVa, rx_ring->pPSRingPa); +@@ -545,10 +545,10 @@ int et131x_init_recv(struct et131x_adapt + PMP_RFD rfd = NULL; + u32 rfdct; + u32 numrfd = 0; +- RX_RING_t *rx_ring = NULL; ++ struct rx_ring *rx_ring; + + /* Setup some convenience pointers */ +- rx_ring = (RX_RING_t *) &adapter->RxRing; ++ rx_ring = &adapter->rx_ring; + + /* Setup each RFD */ + for (rfdct = 0; rfdct < rx_ring->NumRfd; rfdct++) { +@@ -592,7 +592,7 @@ int et131x_init_recv(struct et131x_adapt + void ConfigRxDmaRegs(struct et131x_adapter *etdev) + { + struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; +- struct _rx_ring_t *rx_local = &etdev->RxRing; ++ struct rx_ring *rx_local = &etdev->rx_ring; + struct fbr_desc *fbr_entry; + u32 entry; + u32 psr_num_des; +@@ -741,19 +741,19 @@ void et131x_rx_dma_enable(struct et131x_ + /* Setup the receive dma configuration register for normal operation */ + u32 csr = 0x2000; /* FBR1 enable */ + +- if (etdev->RxRing.Fbr1BufferSize == 4096) ++ if (etdev->rx_ring.Fbr1BufferSize == 4096) + csr |= 0x0800; +- else if (etdev->RxRing.Fbr1BufferSize == 8192) ++ else if (etdev->rx_ring.Fbr1BufferSize == 8192) + csr |= 0x1000; +- else if (etdev->RxRing.Fbr1BufferSize == 16384) ++ else if (etdev->rx_ring.Fbr1BufferSize == 16384) + csr |= 0x1800; + #ifdef USE_FBR0 + csr |= 0x0400; /* FBR0 enable */ +- if (etdev->RxRing.Fbr0BufferSize == 256) ++ if (etdev->rx_ring.Fbr0BufferSize == 256) + csr |= 0x0100; +- else if (etdev->RxRing.Fbr0BufferSize == 512) ++ else if (etdev->rx_ring.Fbr0BufferSize == 512) + csr |= 0x0200; +- else if (etdev->RxRing.Fbr0BufferSize == 1024) ++ else if (etdev->rx_ring.Fbr0BufferSize == 1024) + csr |= 0x0300; + #endif + writel(csr, &etdev->regs->rxdma.csr); +@@ -783,7 +783,7 @@ void et131x_rx_dma_enable(struct et131x_ + */ + PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) + { +- struct _rx_ring_t *rx_local = &etdev->RxRing; ++ struct rx_ring *rx_local = &etdev->rx_ring; + struct rx_status_block *status; + struct pkt_stat_desc *psr; + PMP_RFD rfd; +@@ -1006,7 +1006,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + */ + void et131x_reset_recv(struct et131x_adapter *etdev) + { +- WARN_ON(list_empty(&etdev->RxRing.RecvList)); ++ WARN_ON(list_empty(&etdev->rx_ring.RecvList)); + + } + +@@ -1024,8 +1024,8 @@ void et131x_handle_recv_interrupt(struct + + /* Process up to available RFD's */ + while (count < NUM_PACKETS_HANDLED) { +- if (list_empty(&etdev->RxRing.RecvList)) { +- WARN_ON(etdev->RxRing.nReadyRecv != 0); ++ if (list_empty(&etdev->rx_ring.RecvList)) { ++ WARN_ON(etdev->rx_ring.nReadyRecv != 0); + done = false; + break; + } +@@ -1050,7 +1050,7 @@ void et131x_handle_recv_interrupt(struct + etdev->Stats.ipackets++; + + /* Set the status on the packet, either resources or success */ +- if (etdev->RxRing.nReadyRecv < RFD_LOW_WATER_MARK) { ++ if (etdev->rx_ring.nReadyRecv < RFD_LOW_WATER_MARK) { + dev_warn(&etdev->pdev->dev, + "RFD's are running out\n"); + } +@@ -1058,12 +1058,12 @@ void et131x_handle_recv_interrupt(struct + } + + if (count == NUM_PACKETS_HANDLED || !done) { +- etdev->RxRing.UnfinishedReceives = true; ++ etdev->rx_ring.UnfinishedReceives = true; + writel(PARM_TX_TIME_INT_DEF * NANO_IN_A_MICRO, + &etdev->regs->global.watchdog_timer); + } else + /* Watchdog timer will disable itself if appropriate. */ +- etdev->RxRing.UnfinishedReceives = false; ++ etdev->rx_ring.UnfinishedReceives = false; + } + + static inline u32 bump_fbr(u32 *fbr, u32 limit) +@@ -1091,7 +1091,7 @@ static inline u32 bump_fbr(u32 *fbr, u32 + */ + void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD rfd) + { +- struct _rx_ring_t *rx_local = &etdev->RxRing; ++ struct rx_ring *rx_local = &etdev->rx_ring; + struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; + u16 bi = rfd->bufferindex; + u8 ri = rfd->ringindex; +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -191,10 +191,10 @@ struct fbr_lookup { + }; + + /* +- * RX_RING_t is sructure representing the adaptor's local reference(s) to the +- * rings ++ * struct rx_ring is the ssructure representing the adaptor's local ++ * reference(s) to the rings + */ +-typedef struct _rx_ring_t { ++struct rx_ring { + #ifdef USE_FBR0 + void *pFbr0RingVa; + dma_addr_t pFbr0RingPa; +@@ -239,7 +239,7 @@ typedef struct _rx_ring_t { + + /* lookaside lists */ + struct kmem_cache *RecvLookaside; +-} RX_RING_t, *PRX_RING_t; ++}; + + /* Forward reference of RFD */ + struct _MP_RFD; +--- a/drivers/staging/et131x/et131x_adapter.h ++++ b/drivers/staging/et131x/et131x_adapter.h +@@ -248,7 +248,7 @@ struct et131x_adapter { + struct tx_ring tx_ring; + + /* Rx Memory Variables */ +- RX_RING_t RxRing; ++ struct rx_ring rx_ring; + + /* Loopback specifics */ + u8 ReplicaPhyLoopbk; /* Replica Enable */ +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -185,7 +185,7 @@ irqreturn_t et131x_isr(int irq, void *de + if (++tcb->stale > 1) + status |= ET_INTR_TXDMA_ISR; + +- if (adapter->RxRing.UnfinishedReceives) ++ if (adapter->rx_ring.UnfinishedReceives) + status |= ET_INTR_RXDMA_XFR_DONE; + else if (tcb == NULL) + writel(0, &adapter->regs->global.watchdog_timer); diff --git a/staging/staging-et131x-kill-off-rxmac_pf_ctrl_t.patch b/staging/staging-et131x-kill-off-rxmac_pf_ctrl_t.patch new file mode 100644 index 00000000000000..8fe51cf9910e6b --- /dev/null +++ b/staging/staging-et131x-kill-off-rxmac_pf_ctrl_t.patch @@ -0,0 +1,204 @@ +From alan@linux.intel.com Wed Jan 27 15:45:09 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:57 +0000 +Subject: Staging: et131x: kill off RXMAC_PF_CTRL_t +To: greg@kroah.com +Message-ID: <20100118153457.6884.24480.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 32 +++++++------------------- + drivers/staging/et131x/et1310_mac.c | 18 ++++++-------- + drivers/staging/et131x/et131x_netdev.c | 34 +++++++++++++--------------- + 3 files changed, 33 insertions(+), 51 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -830,29 +830,15 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for Packet Filter Control reg in rxmac address map + * located at address 0x4084 ++ * ++ * 31-23: unused ++ * 22-16: min_pkt_size ++ * 15-4: unused ++ * 3: filter_frag_en ++ * 2: filter_uni_en ++ * 1: filter_multi_en ++ * 0: filter_broad_en + */ +-typedef union _RXMAC_PF_CTRL_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused2:9; /* bits 23-31 */ +- u32 min_pkt_size:7; /* bits 16-22 */ +- u32 unused1:12; /* bits 4-15 */ +- u32 filter_frag_en:1; /* bit 3 */ +- u32 filter_uni_en:1; /* bit 2 */ +- u32 filter_multi_en:1; /* bit 1 */ +- u32 filter_broad_en:1; /* bit 0 */ +-#else +- u32 filter_broad_en:1; /* bit 0 */ +- u32 filter_multi_en:1; /* bit 1 */ +- u32 filter_uni_en:1; /* bit 2 */ +- u32 filter_frag_en:1; /* bit 3 */ +- u32 unused1:12; /* bits 4-15 */ +- u32 min_pkt_size:7; /* bits 16-22 */ +- u32 unused2:9; /* bits 23-31 */ +-#endif +- } bits; +-} RXMAC_PF_CTRL_t, *PRXMAC_PF_CTRL_t; + + /* + * structure for Memory Controller Interface Control Max Segment reg in rxmac +@@ -1017,7 +1003,7 @@ typedef struct _RXMAC_t { /* Location + u32 multi_hash2; /* 0x4078 */ + u32 multi_hash3; /* 0x407C */ + u32 multi_hash4; /* 0x4080 */ +- RXMAC_PF_CTRL_t pf_ctrl; /* 0x4084 */ ++ u32 pf_ctrl; /* 0x4084 */ + RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg; /* 0x4088 */ + RXMAC_MCIF_WATER_MARK_t mcif_water_mark; /* 0x408C */ + RXMAC_RXQ_DIAG_t rxq_diag; /* 0x4090 */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -241,7 +241,7 @@ void ConfigRxMacRegs(struct et131x_adapt + struct _RXMAC_t __iomem *pRxMac = &etdev->regs->rxmac; + RXMAC_WOL_SA_LO_t sa_lo; + RXMAC_WOL_SA_HI_t sa_hi; +- RXMAC_PF_CTRL_t pf_ctrl = { 0 }; ++ u32 pf_ctrl = 0; + + /* Disable the MAC while it is being configured (also disable WOL) */ + writel(0x8, &pRxMac->ctrl.value); +@@ -292,12 +292,12 @@ void ConfigRxMacRegs(struct et131x_adapt + writel(sa_hi.value, &pRxMac->sa_hi.value); + + /* Disable all Packet Filtering */ +- writel(0, &pRxMac->pf_ctrl.value); ++ writel(0, &pRxMac->pf_ctrl); + + /* Let's initialize the Unicast Packet filtering address */ + if (etdev->PacketFilter & ET131X_PACKET_TYPE_DIRECTED) { + SetupDeviceForUnicast(etdev); +- pf_ctrl.bits.filter_uni_en = 1; ++ pf_ctrl |= 4; /* Unicast filter */ + } else { + writel(0, &pRxMac->uni_pf_addr1.value); + writel(0, &pRxMac->uni_pf_addr2.value); +@@ -305,16 +305,14 @@ void ConfigRxMacRegs(struct et131x_adapt + } + + /* Let's initialize the Multicast hash */ +- if (etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST) { +- pf_ctrl.bits.filter_multi_en = 0; +- } else { +- pf_ctrl.bits.filter_multi_en = 1; ++ if (!(etdev->PacketFilter & ET131X_PACKET_TYPE_ALL_MULTICAST)) { ++ pf_ctrl |= 2; /* Multicast filter */ + SetupDeviceForMulticast(etdev); + } + + /* Runt packet filtering. Didn't work in version A silicon. */ +- pf_ctrl.bits.min_pkt_size = NIC_MIN_PACKET_SIZE + 4; +- pf_ctrl.bits.filter_frag_en = 1; ++ pf_ctrl |= (NIC_MIN_PACKET_SIZE + 4) << 16; ++ pf_ctrl |= 8; /* Fragment filter */ + + if (etdev->RegistryJumboPacket > 8192) { + RXMAC_MCIF_CTRL_MAX_SEG_t mcif_ctrl_max_seg; +@@ -370,7 +368,7 @@ void ConfigRxMacRegs(struct et131x_adapt + * dropping doesn't work, so it is disabled in the pf_ctrl register, + * but we still leave the packet filter on. + */ +- writel(pf_ctrl.value, &pRxMac->pf_ctrl.value); ++ writel(pf_ctrl, &pRxMac->pf_ctrl); + writel(0x9, &pRxMac->ctrl.value); + } + +--- a/drivers/staging/et131x/et131x_netdev.c ++++ b/drivers/staging/et131x/et131x_netdev.c +@@ -334,6 +334,8 @@ int et131x_ioctl(struct net_device *netd + * et131x_set_packet_filter - Configures the Rx Packet filtering on the device + * @adapter: pointer to our private adapter structure + * ++ * FIXME: lot of dups with MAC code ++ * + * Returns 0 on success, errno on failure + */ + int et131x_set_packet_filter(struct et131x_adapter *adapter) +@@ -341,10 +343,10 @@ int et131x_set_packet_filter(struct et13 + int status = 0; + uint32_t filter = adapter->PacketFilter; + RXMAC_CTRL_t ctrl; +- RXMAC_PF_CTRL_t pf_ctrl; ++ u32 pf_ctrl; + + ctrl.value = readl(&adapter->regs->rxmac.ctrl.value); +- pf_ctrl.value = readl(&adapter->regs->rxmac.pf_ctrl.value); ++ pf_ctrl = readl(&adapter->regs->rxmac.pf_ctrl); + + /* Default to disabled packet filtering. Enable it in the individual + * case statements that require the device to filter something +@@ -354,45 +356,41 @@ int et131x_set_packet_filter(struct et13 + /* Set us to be in promiscuous mode so we receive everything, this + * is also true when we get a packet filter of 0 + */ +- if ((filter & ET131X_PACKET_TYPE_PROMISCUOUS) || filter == 0) { +- pf_ctrl.bits.filter_broad_en = 0; +- pf_ctrl.bits.filter_multi_en = 0; +- pf_ctrl.bits.filter_uni_en = 0; +- } else { ++ if ((filter & ET131X_PACKET_TYPE_PROMISCUOUS) || filter == 0) ++ pf_ctrl &= ~7; /* Clear filter bits */ ++ else { + /* + * Set us up with Multicast packet filtering. Three cases are + * possible - (1) we have a multi-cast list, (2) we receive ALL + * multicast entries or (3) we receive none. + */ +- if (filter & ET131X_PACKET_TYPE_ALL_MULTICAST) { +- pf_ctrl.bits.filter_multi_en = 0; +- } else { ++ if (filter & ET131X_PACKET_TYPE_ALL_MULTICAST) ++ pf_ctrl &= ~2; /* Multicast filter bit */ ++ else { + SetupDeviceForMulticast(adapter); +- pf_ctrl.bits.filter_multi_en = 1; ++ pf_ctrl |= 2; + ctrl.bits.pkt_filter_disable = 0; + } + + /* Set us up with Unicast packet filtering */ + if (filter & ET131X_PACKET_TYPE_DIRECTED) { + SetupDeviceForUnicast(adapter); +- pf_ctrl.bits.filter_uni_en = 1; ++ pf_ctrl |= 4; + ctrl.bits.pkt_filter_disable = 0; + } + + /* Set us up with Broadcast packet filtering */ + if (filter & ET131X_PACKET_TYPE_BROADCAST) { +- pf_ctrl.bits.filter_broad_en = 1; ++ pf_ctrl |= 1; /* Broadcast filter bit */ + ctrl.bits.pkt_filter_disable = 0; +- } else { +- pf_ctrl.bits.filter_broad_en = 0; +- } ++ } else ++ pf_ctrl &= ~1; + + /* Setup the receive mac configuration registers - Packet + * Filter control + the enable / disable for packet filter + * in the control reg. + */ +- writel(pf_ctrl.value, +- &adapter->regs->rxmac.pf_ctrl.value); ++ writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl); + writel(ctrl.value, &adapter->regs->rxmac.ctrl.value); + } + return status; diff --git a/staging/staging-et131x-kill-off-the-fbr_num_des-type.patch b/staging/staging-et131x-kill-off-the-fbr_num_des-type.patch new file mode 100644 index 00000000000000..f2529dcbd828a2 --- /dev/null +++ b/staging/staging-et131x-kill-off-the-fbr_num_des-type.patch @@ -0,0 +1,39 @@ +From alan@linux.intel.com Wed Jan 27 15:38:05 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:32:39 +0000 +Subject: Staging: et131x: kill off the FBR_NUM_DES type +To: greg@kroah.com +Message-ID: <20100118153239.6884.4367.stgit@localhost.localdomain> + + +This is another 10 bit value with the high bits clear, and where the +type doesn't get used anywhere properly anyway + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 12 ------------ + 1 file changed, 12 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -451,18 +451,6 @@ typedef union _RXDMA_CSR_t { + * 31-10: unused + * 9-0: fbr ndesc + */ +-typedef union _RXDMA_FBR_NUM_DES_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused:22; /* bits 10-31 */ +- u32 fbr_ndesc:10; /* bits 0-9 */ +-#else +- u32 fbr_ndesc:10; /* bits 0-9 */ +- u32 unused:22; /* bits 10-31 */ +-#endif +- } bits; +-} RXDMA_FBR_NUM_DES_t, *PRXDMA_FBR_NUM_DES_t; + + /* + * structure for free buffer ring 0 available offset reg in rxdma address map diff --git a/staging/staging-et131x-kill-off-the-rx-interrupt-state-enum.patch b/staging/staging-et131x-kill-off-the-rx-interrupt-state-enum.patch new file mode 100644 index 00000000000000..8eb052ef5fa802 --- /dev/null +++ b/staging/staging-et131x-kill-off-the-rx-interrupt-state-enum.patch @@ -0,0 +1,31 @@ +From alan@linux.intel.com Wed Jan 27 15:43:13 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:40 +0000 +Subject: Staging: et131x: kill off the rx interrupt state enum +To: greg@kroah.com +Message-ID: <20100118153339.6884.93205.stgit@localhost.localdomain> + + +Another verbose enum we don't need + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.h | 5 ----- + 1 file changed, 5 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -238,11 +238,6 @@ typedef struct _FbrLookupTable { + u32 PALow[MAX_DESC_PER_RING_RX]; + } FBRLOOKUPTABLE, *PFBRLOOKUPTABLE; + +-typedef enum { +- ONE_PACKET_INTERRUPT, +- FOUR_PACKET_INTERRUPT +-} eRX_INTERRUPT_STATE_t, *PeRX_INTERRUPT_STATE_t; +- + /* + * RX_RING_t is sructure representing the adaptor's local reference(s) to the + * rings diff --git a/staging/staging-et131x-kill-off-the-rxdma-type.patch b/staging/staging-et131x-kill-off-the-rxdma-type.patch new file mode 100644 index 00000000000000..941780e17a3f44 --- /dev/null +++ b/staging/staging-et131x-kill-off-the-rxdma-type.patch @@ -0,0 +1,71 @@ +From alan@linux.intel.com Wed Jan 27 15:39:05 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:01 +0000 +Subject: Staging: et131x: Kill off the rxdma type +To: greg@kroah.com +Message-ID: <20100118153301.6884.26272.stgit@localhost.localdomain> + + +We have a clean struct of this now so turn the top level typedefs into a +struct + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 8 ++++---- + drivers/staging/et131x/et1310_rx.c | 4 ++-- + 2 files changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -500,7 +500,7 @@ typedef struct _TXDMA_t { /* Location: + * Rx DMA Module of JAGCore Address Mapping + * Located at address 0x2000 + */ +-typedef struct _RXDMA_t { /* Location: */ ++struct rxdma_regs { /* Location: */ + u32 csr; /* 0x2000 */ + u32 dma_wb_base_lo; /* 0x2004 */ + u32 dma_wb_base_hi; /* 0x2008 */ +@@ -530,7 +530,7 @@ typedef struct _RXDMA_t { /* Location + u32 fbr1_full_offset; /* 0x2068 */ + u32 fbr1_rd_index; /* 0x206C */ + u32 fbr1_min_des; /* 0x2070 */ +-} RXDMA_t, *PRXDMA_t; ++}; + + /* END OF RXDMA REGISTER ADDRESS MAP */ + +@@ -1688,9 +1688,9 @@ typedef struct _ADDRESS_MAP_t { + TXDMA_t txdma; + /* unused section of txdma address map */ + u8 unused_txdma[4096 - sizeof(TXDMA_t)]; +- RXDMA_t rxdma; ++ struct rxdma_regs rxdma; + /* unused section of rxdma address map */ +- u8 unused_rxdma[4096 - sizeof(RXDMA_t)]; ++ u8 unused_rxdma[4096 - sizeof(struct rxdma_regs)]; + TXMAC_t txmac; + /* unused section of txmac address map */ + u8 unused_txmac[4096 - sizeof(TXMAC_t)]; +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -593,7 +593,7 @@ int et131x_init_recv(struct et131x_adapt + */ + void ConfigRxDmaRegs(struct et131x_adapter *etdev) + { +- struct _RXDMA_t __iomem *rx_dma = &etdev->regs->rxdma; ++ struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; + struct _rx_ring_t *rx_local = &etdev->RxRing; + struct fbr_desc *fbr_entry; + u32 entry; +@@ -1097,7 +1097,7 @@ static inline u32 bump_fbr(u32 *fbr, u32 + void nic_return_rfd(struct et131x_adapter *etdev, PMP_RFD rfd) + { + struct _rx_ring_t *rx_local = &etdev->RxRing; +- struct _RXDMA_t __iomem *rx_dma = &etdev->regs->rxdma; ++ struct rxdma_regs __iomem *rx_dma = &etdev->regs->rxdma; + uint16_t bi = rfd->bufferindex; + uint8_t ri = rfd->ringindex; + unsigned long flags; diff --git a/staging/staging-et131x-kill-off-the-rxmac-ctrl-type.patch b/staging/staging-et131x-kill-off-the-rxmac-ctrl-type.patch new file mode 100644 index 00000000000000..135e598bfb80cc --- /dev/null +++ b/staging/staging-et131x-kill-off-the-rxmac-ctrl-type.patch @@ -0,0 +1,156 @@ +From alan@linux.intel.com Wed Jan 27 15:46:04 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:30 +0000 +Subject: Staging: et131x: kill off the rxmac ctrl type +To: greg@kroah.com +Message-ID: <20100118153530.6884.93225.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 35 ++++++++-------------------- + drivers/staging/et131x/et1310_mac.c | 4 +-- + drivers/staging/et131x/et131x_isr.c | 2 - + drivers/staging/et131x/et131x_netdev.c | 14 +++++------ + 4 files changed, 20 insertions(+), 35 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -655,31 +655,16 @@ struct txmac_regs { /* Location: */ + /* + * structure for rxmac control reg in rxmac address map + * located at address 0x4000 ++ * ++ * 31-7: reserved ++ * 6: rxmac_int_disable ++ * 5: async_disable ++ * 4: mif_disable ++ * 3: wol_disable ++ * 2: pkt_filter_disable ++ * 1: mcif_disable ++ * 0: rxmac_en + */ +-typedef union _RXMAC_CTRL_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved:25; /* bits 7-31 */ +- u32 rxmac_int_disable:1; /* bit 6 */ +- u32 async_disable:1; /* bit 5 */ +- u32 mif_disable:1; /* bit 4 */ +- u32 wol_disable:1; /* bit 3 */ +- u32 pkt_filter_disable:1; /* bit 2 */ +- u32 mcif_disable:1; /* bit 1 */ +- u32 rxmac_en:1; /* bit 0 */ +-#else +- u32 rxmac_en:1; /* bit 0 */ +- u32 mcif_disable:1; /* bit 1 */ +- u32 pkt_filter_disable:1; /* bit 2 */ +- u32 wol_disable:1; /* bit 3 */ +- u32 mif_disable:1; /* bit 4 */ +- u32 async_disable:1; /* bit 5 */ +- u32 rxmac_int_disable:1; /* bit 6 */ +- u32 reserved:25; /* bits 7-31 */ +-#endif +- } bits; +-} RXMAC_CTRL_t, *PRXMAC_CTRL_t; + + /* + * structure for Wake On Lan Control and CRC 0 reg in rxmac address map +@@ -904,7 +889,7 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + * Rx MAC Module of JAGCore Address Mapping + */ + typedef struct _RXMAC_t { /* Location: */ +- RXMAC_CTRL_t ctrl; /* 0x4000 */ ++ u32 ctrl; /* 0x4000 */ + u32 crc0; /* 0x4004 */ + u32 crc12; /* 0x4008 */ + u32 crc34; /* 0x400C */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -244,7 +244,7 @@ void ConfigRxMacRegs(struct et131x_adapt + u32 pf_ctrl = 0; + + /* Disable the MAC while it is being configured (also disable WOL) */ +- writel(0x8, &pRxMac->ctrl.value); ++ writel(0x8, &pRxMac->ctrl); + + /* Initialize WOL to disabled. */ + writel(0, &pRxMac->crc0); +@@ -363,7 +363,7 @@ void ConfigRxMacRegs(struct et131x_adapt + * but we still leave the packet filter on. + */ + writel(pf_ctrl, &pRxMac->pf_ctrl); +- writel(0x9, &pRxMac->ctrl.value); ++ writel(0x9, &pRxMac->ctrl); + } + + void ConfigTxMacRegs(struct et131x_adapter *etdev) +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -445,7 +445,7 @@ void et131x_isr_handler(struct work_stru + + dev_warn(&etdev->pdev->dev, + "Enable 0x%08x, Diag 0x%08x\n", +- readl(&iomem->rxmac.ctrl.value), ++ readl(&iomem->rxmac.ctrl), + readl(&iomem->rxmac.rxq_diag)); + + /* +--- a/drivers/staging/et131x/et131x_netdev.c ++++ b/drivers/staging/et131x/et131x_netdev.c +@@ -342,16 +342,16 @@ int et131x_set_packet_filter(struct et13 + { + int status = 0; + uint32_t filter = adapter->PacketFilter; +- RXMAC_CTRL_t ctrl; ++ u32 ctrl; + u32 pf_ctrl; + +- ctrl.value = readl(&adapter->regs->rxmac.ctrl.value); ++ ctrl = readl(&adapter->regs->rxmac.ctrl); + pf_ctrl = readl(&adapter->regs->rxmac.pf_ctrl); + + /* Default to disabled packet filtering. Enable it in the individual + * case statements that require the device to filter something + */ +- ctrl.bits.pkt_filter_disable = 1; ++ ctrl |= 0x04; + + /* Set us to be in promiscuous mode so we receive everything, this + * is also true when we get a packet filter of 0 +@@ -369,20 +369,20 @@ int et131x_set_packet_filter(struct et13 + else { + SetupDeviceForMulticast(adapter); + pf_ctrl |= 2; +- ctrl.bits.pkt_filter_disable = 0; ++ ctrl &= ~0x04; + } + + /* Set us up with Unicast packet filtering */ + if (filter & ET131X_PACKET_TYPE_DIRECTED) { + SetupDeviceForUnicast(adapter); + pf_ctrl |= 4; +- ctrl.bits.pkt_filter_disable = 0; ++ ctrl &= ~0x04; + } + + /* Set us up with Broadcast packet filtering */ + if (filter & ET131X_PACKET_TYPE_BROADCAST) { + pf_ctrl |= 1; /* Broadcast filter bit */ +- ctrl.bits.pkt_filter_disable = 0; ++ ctrl &= ~0x04; + } else + pf_ctrl &= ~1; + +@@ -391,7 +391,7 @@ int et131x_set_packet_filter(struct et13 + * in the control reg. + */ + writel(pf_ctrl, &adapter->regs->rxmac.pf_ctrl); +- writel(ctrl.value, &adapter->regs->rxmac.ctrl.value); ++ writel(ctrl, &adapter->regs->rxmac.ctrl); + } + return status; + } diff --git a/staging/staging-et131x-kill-off-the-rxq_diag-types.patch b/staging/staging-et131x-kill-off-the-rxq_diag-types.patch new file mode 100644 index 00000000000000..54f82a1d9522f2 --- /dev/null +++ b/staging/staging-et131x-kill-off-the-rxq_diag-types.patch @@ -0,0 +1,67 @@ +From alan@linux.intel.com Wed Jan 27 15:45:29 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:08 +0000 +Subject: Staging: et131x: Kill off the rxq_diag types +To: greg@kroah.com +Message-ID: <20100118153508.6884.59893.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 23 ++++++----------------- + drivers/staging/et131x/et131x_isr.c | 2 +- + 2 files changed, 7 insertions(+), 18 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -863,23 +863,12 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for Rx Queue Dialog reg in rxmac address map. + * located at address 0x4090 ++ * ++ * 31-26: reserved ++ * 25-16: rd_ptr ++ * 15-10: reserved ++ * 9-0: wr_ptr + */ +-typedef union _RXMAC_RXQ_DIAG_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved2:6; /* bits 26-31 */ +- u32 rd_ptr:10; /* bits 16-25 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 wr_ptr:10; /* bits 0-9 */ +-#else +- u32 wr_ptr:10; /* bits 0-9 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 rd_ptr:10; /* bits 16-25 */ +- u32 reserved2:6; /* bits 26-31 */ +-#endif +- } bits; +-} RXMAC_RXQ_DIAG_t, *PRXMAC_RXQ_DIAG_t; + + /* + * structure for space availiable reg in rxmac address map. +@@ -984,7 +973,7 @@ typedef struct _RXMAC_t { /* Location + u32 pf_ctrl; /* 0x4084 */ + u32 mcif_ctrl_max_seg; /* 0x4088 */ + u32 mcif_water_mark; /* 0x408C */ +- RXMAC_RXQ_DIAG_t rxq_diag; /* 0x4090 */ ++ u32 rxq_diag; /* 0x4090 */ + RXMAC_SPACE_AVAIL_t space_avail; /* 0x4094 */ + + RXMAC_MIF_CTL_t mif_ctrl; /* 0x4098 */ +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -446,7 +446,7 @@ void et131x_isr_handler(struct work_stru + dev_warn(&etdev->pdev->dev, + "Enable 0x%08x, Diag 0x%08x\n", + readl(&iomem->rxmac.ctrl.value), +- readl(&iomem->rxmac.rxq_diag.value)); ++ readl(&iomem->rxmac.rxq_diag)); + + /* + * If we are debugging, we want to see this error, diff --git a/staging/staging-et131x-kill-off-the-txmac_err_t-type.patch b/staging/staging-et131x-kill-off-the-txmac_err_t-type.patch new file mode 100644 index 00000000000000..0a2ca8ae49ad7f --- /dev/null +++ b/staging/staging-et131x-kill-off-the-txmac_err_t-type.patch @@ -0,0 +1,84 @@ +From alan@linux.intel.com Wed Jan 27 15:44:47 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:40 +0000 +Subject: Staging: et131x: Kill off the TXMAC_ERR_t type +To: greg@kroah.com +Message-ID: <20100118153440.6884.55847.stgit@localhost.localdomain> + + +This is another one we don't really need to do much to get rid of + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 38 ++++++++-------------------- + drivers/staging/et131x/et131x_isr.c | 2 - + 2 files changed, 12 insertions(+), 28 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -597,33 +597,17 @@ struct rxdma_regs { /* Location: */ + /* + * structure for error reg in txmac address map + * located at address 0x3018 ++ * ++ * 31-9: unused ++ * 8: fifo_underrun ++ * 7-6: unused ++ * 5: ctrl2_err ++ * 4: txq_underrun ++ * 3: bcnt_err ++ * 2: lseg_err ++ * 1: segnum_err ++ * 0: seg0_err + */ +-typedef union _TXMAC_ERR_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused2:23; /* bits 9-31 */ +- u32 fifo_underrun:1; /* bit 8 */ +- u32 unused1:2; /* bits 6-7 */ +- u32 ctrl2_err:1; /* bit 5 */ +- u32 txq_underrun:1; /* bit 4 */ +- u32 bcnt_err:1; /* bit 3 */ +- u32 lseg_err:1; /* bit 2 */ +- u32 segnum_err:1; /* bit 1 */ +- u32 seg0_err:1; /* bit 0 */ +-#else +- u32 seg0_err:1; /* bit 0 */ +- u32 segnum_err:1; /* bit 1 */ +- u32 lseg_err:1; /* bit 2 */ +- u32 bcnt_err:1; /* bit 3 */ +- u32 txq_underrun:1; /* bit 4 */ +- u32 ctrl2_err:1; /* bit 5 */ +- u32 unused1:2; /* bits 6-7 */ +- u32 fifo_underrun:1; /* bit 8 */ +- u32 unused2:23; /* bits 9-31 */ +-#endif +- } bits; +-} TXMAC_ERR_t, *PTXMAC_ERR_t; + + /* + * structure for error interrupt reg in txmac address map +@@ -675,7 +659,7 @@ typedef struct _TXMAC_t { /* Location: + u32 max_fill; /* 0x300C */ + u32 cf_param; /* 0x3010 */ + u32 tx_test; /* 0x3014 */ +- TXMAC_ERR_t err; /* 0x3018 */ ++ u32 err; /* 0x3018 */ + TXMAC_ERR_INT_t err_int; /* 0x301C */ + u32 bp_ctrl; /* 0x3020 */ + } TXMAC_t, *PTXMAC_t; +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -406,7 +406,7 @@ void et131x_isr_handler(struct work_stru + + /* Let's move on to the TxMac */ + if (status & ET_INTR_TXMAC) { +- u32 err = readl(&iomem->txmac.err.value); ++ u32 err = readl(&iomem->txmac.err); + + /* + * When any of the errors occur and TXMAC generates diff --git a/staging/staging-et131x-kill-off-txdma_t.patch b/staging/staging-et131x-kill-off-txdma_t.patch new file mode 100644 index 00000000000000..26944d1c7e976a --- /dev/null +++ b/staging/staging-et131x-kill-off-txdma_t.patch @@ -0,0 +1,62 @@ +From alan@linux.intel.com Wed Jan 27 15:40:11 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:18 +0000 +Subject: Staging: et131x: Kill off TXDMA_t +To: greg@kroah.com +Message-ID: <20100118153317.6884.41049.stgit@localhost.localdomain> + + +All the contents are clean so kill off the top level typedefs + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> +--- + + drivers/staging/et131x/et1310_address_map.h | 8 ++++---- + drivers/staging/et131x/et1310_tx.c | 2 +- + 2 files changed, 5 insertions(+), 5 deletions(-) + + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -253,7 +253,7 @@ extern inline void add_12bit(u32 *v, int + * Tx DMA Module of JAGCore Address Mapping + * Located at address 0x1000 + */ +-typedef struct _TXDMA_t { /* Location: */ ++struct txdma_regs { /* Location: */ + u32 csr; /* 0x1000 */ + u32 pr_base_hi; /* 0x1004 */ + u32 pr_base_lo; /* 0x1008 */ +@@ -280,7 +280,7 @@ typedef struct _TXDMA_t { /* Location: + u32 DroppedTLPCount; /* 0x105c */ + u32 NewServiceComplete; /* 0x1060 */ + u32 EthernetPacketCount; /* 0x1064 */ +-} TXDMA_t, *PTXDMA_t; ++}; + + /* END OF TXDMA REGISTER ADDRESS MAP */ + +@@ -1667,9 +1667,9 @@ typedef struct _ADDRESS_MAP_t { + struct global_regs global; + /* unused section of global address map */ + u8 unused_global[4096 - sizeof(struct global_regs)]; +- TXDMA_t txdma; ++ struct txdma_regs txdma; + /* unused section of txdma address map */ +- u8 unused_txdma[4096 - sizeof(TXDMA_t)]; ++ u8 unused_txdma[4096 - sizeof(struct txdma_regs)]; + struct rxdma_regs rxdma; + /* unused section of rxdma address map */ + u8 unused_rxdma[4096 - sizeof(struct rxdma_regs)]; +--- a/drivers/staging/et131x/et1310_tx.c ++++ b/drivers/staging/et131x/et1310_tx.c +@@ -200,7 +200,7 @@ void et131x_tx_dma_memory_free(struct et + */ + void ConfigTxDmaRegs(struct et131x_adapter *etdev) + { +- struct _TXDMA_t __iomem *txdma = &etdev->regs->txdma; ++ struct txdma_regs __iomem *txdma = &etdev->regs->txdma; + + /* Load the hardware with the start of the transmit descriptor ring. */ + writel((u32) ((u64)etdev->tx_ring.tx_desc_ring_pa >> 32), diff --git a/staging/staging-et131x-kill-rxmac-crc-fields.patch b/staging/staging-et131x-kill-rxmac-crc-fields.patch new file mode 100644 index 00000000000000..fb2ec87239873d --- /dev/null +++ b/staging/staging-et131x-kill-rxmac-crc-fields.patch @@ -0,0 +1,142 @@ +From alan@linux.intel.com Wed Jan 27 15:45:02 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:51 +0000 +Subject: Staging: et131x: Kill rxmac crc fields +To: greg@kroah.com +Message-ID: <20100118153451.6884.5466.stgit@localhost.localdomain> + + +More we don't need + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 82 ++++++---------------------- + drivers/staging/et131x/et1310_mac.c | 6 +- + 2 files changed, 22 insertions(+), 66 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -684,77 +684,33 @@ typedef union _RXMAC_CTRL_t { + /* + * structure for Wake On Lan Control and CRC 0 reg in rxmac address map + * located at address 0x4004 ++ * 31-16: crc ++ * 15-12: reserved ++ * 11: ignore_pp ++ * 10: ignore_mp ++ * 9: clr_intr ++ * 8: ignore_link_chg ++ * 7: ignore_uni ++ * 6: ignore_multi ++ * 5: ignore_broad ++ * 4-0: valid_crc 4-0 + */ +-typedef union _RXMAC_WOL_CTL_CRC0_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 crc0:16; /* bits 16-31 */ +- u32 reserve:4; /* bits 12-15 */ +- u32 ignore_pp:1; /* bit 11 */ +- u32 ignore_mp:1; /* bit 10 */ +- u32 clr_intr:1; /* bit 9 */ +- u32 ignore_link_chg:1; /* bit 8 */ +- u32 ignore_uni:1; /* bit 7 */ +- u32 ignore_multi:1; /* bit 6 */ +- u32 ignore_broad:1; /* bit 5 */ +- u32 valid_crc4:1; /* bit 4 */ +- u32 valid_crc3:1; /* bit 3 */ +- u32 valid_crc2:1; /* bit 2 */ +- u32 valid_crc1:1; /* bit 1 */ +- u32 valid_crc0:1; /* bit 0 */ +-#else +- u32 valid_crc0:1; /* bit 0 */ +- u32 valid_crc1:1; /* bit 1 */ +- u32 valid_crc2:1; /* bit 2 */ +- u32 valid_crc3:1; /* bit 3 */ +- u32 valid_crc4:1; /* bit 4 */ +- u32 ignore_broad:1; /* bit 5 */ +- u32 ignore_multi:1; /* bit 6 */ +- u32 ignore_uni:1; /* bit 7 */ +- u32 ignore_link_chg:1; /* bit 8 */ +- u32 clr_intr:1; /* bit 9 */ +- u32 ignore_mp:1; /* bit 10 */ +- u32 ignore_pp:1; /* bit 11 */ +- u32 reserve:4; /* bits 12-15 */ +- u32 crc0:16; /* bits 16-31 */ +-#endif +- } bits; +-} RXMAC_WOL_CTL_CRC0_t, *PRXMAC_WOL_CTL_CRC0_t; + + /* + * structure for CRC 1 and CRC 2 reg in rxmac address map + * located at address 0x4008 ++ * ++ * 31-16: crc2 ++ * 15-0: crc1 + */ +-typedef union _RXMAC_WOL_CRC12_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 crc2:16; /* bits 16-31 */ +- u32 crc1:16; /* bits 0-15 */ +-#else +- u32 crc1:16; /* bits 0-15 */ +- u32 crc2:16; /* bits 16-31 */ +-#endif +- } bits; +-} RXMAC_WOL_CRC12_t, *PRXMAC_WOL_CRC12_t; + + /* + * structure for CRC 3 and CRC 4 reg in rxmac address map + * located at address 0x400C ++ * ++ * 31-16: crc4 ++ * 15-0: crc3 + */ +-typedef union _RXMAC_WOL_CRC34_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 crc4:16; /* bits 16-31 */ +- u32 crc3:16; /* bits 0-15 */ +-#else +- u32 crc3:16; /* bits 0-15 */ +- u32 crc4:16; /* bits 16-31 */ +-#endif +- } bits; +-} RXMAC_WOL_CRC34_t, *PRXMAC_WOL_CRC34_t; + + /* + * structure for Wake On Lan Source Address Lo reg in rxmac address map +@@ -1029,9 +985,9 @@ typedef union _RXMAC_ERROR_REG_t { + */ + typedef struct _RXMAC_t { /* Location: */ + RXMAC_CTRL_t ctrl; /* 0x4000 */ +- RXMAC_WOL_CTL_CRC0_t crc0; /* 0x4004 */ +- RXMAC_WOL_CRC12_t crc12; /* 0x4008 */ +- RXMAC_WOL_CRC34_t crc34; /* 0x400C */ ++ u32 crc0; /* 0x4004 */ ++ u32 crc12; /* 0x4008 */ ++ u32 crc34; /* 0x400C */ + RXMAC_WOL_SA_LO_t sa_lo; /* 0x4010 */ + RXMAC_WOL_SA_HI_t sa_hi; /* 0x4014 */ + u32 mask0_word0; /* 0x4018 */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -247,9 +247,9 @@ void ConfigRxMacRegs(struct et131x_adapt + writel(0x8, &pRxMac->ctrl.value); + + /* Initialize WOL to disabled. */ +- writel(0, &pRxMac->crc0.value); +- writel(0, &pRxMac->crc12.value); +- writel(0, &pRxMac->crc34.value); ++ writel(0, &pRxMac->crc0); ++ writel(0, &pRxMac->crc12); ++ writel(0, &pRxMac->crc34); + + /* We need to set the WOL mask0 - mask4 next. We initialize it to + * its default Values of 0x00000000 because there are not WOL masks diff --git a/staging/staging-et131x-kill-the-rxmac-error_reg_t.patch b/staging/staging-et131x-kill-the-rxmac-error_reg_t.patch new file mode 100644 index 00000000000000..5c23a47f426c51 --- /dev/null +++ b/staging/staging-et131x-kill-the-rxmac-error_reg_t.patch @@ -0,0 +1,70 @@ +From alan@linux.intel.com Wed Jan 27 15:45:55 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:24 +0000 +Subject: Staging: et131x: kill the rxmac ERROR_REG_t +To: greg@kroah.com +Message-ID: <20100118153524.6884.33549.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 26 +++++++------------------- + drivers/staging/et131x/et131x_isr.c | 2 +- + 2 files changed, 8 insertions(+), 20 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -892,25 +892,13 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for Error reg in rxmac address map. + * located at address 0x409C ++ * ++ * 31-4: unused ++ * 3: mif ++ * 2: async ++ * 1: pkt_filter ++ * 0: mcif + */ +-typedef union _RXMAC_ERROR_REG_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserve:28; /* bits 4-31 */ +- u32 mif:1; /* bit 3 */ +- u32 async:1; /* bit 2 */ +- u32 pkt_filter:1; /* bit 1 */ +- u32 mcif:1; /* bit 0 */ +-#else +- u32 mcif:1; /* bit 0 */ +- u32 pkt_filter:1; /* bit 1 */ +- u32 async:1; /* bit 2 */ +- u32 mif:1; /* bit 3 */ +- u32 reserve:28; /* bits 4-31 */ +-#endif +- } bits; +-} RXMAC_ERROR_REG_t, *PRXMAC_ERROR_REG_t; + + /* + * Rx MAC Module of JAGCore Address Mapping +@@ -956,7 +944,7 @@ typedef struct _RXMAC_t { /* Location + u32 space_avail; /* 0x4094 */ + + u32 mif_ctrl; /* 0x4098 */ +- RXMAC_ERROR_REG_t err_reg; /* 0x409C */ ++ u32 err_reg; /* 0x409C */ + } RXMAC_t, *PRXMAC_t; + + /* END OF RXMAC REGISTER ADDRESS MAP */ +--- a/drivers/staging/et131x/et131x_isr.c ++++ b/drivers/staging/et131x/et131x_isr.c +@@ -441,7 +441,7 @@ void et131x_isr_handler(struct work_stru + + dev_warn(&etdev->pdev->dev, + "RXMAC interrupt, error 0x%08x. Requesting reset\n", +- readl(&iomem->rxmac.err_reg.value)); ++ readl(&iomem->rxmac.err_reg)); + + dev_warn(&etdev->pdev->dev, + "Enable 0x%08x, Diag 0x%08x\n", diff --git a/staging/staging-et131x-kill-the-space_avail-type.patch b/staging/staging-et131x-kill-the-space_avail-type.patch new file mode 100644 index 00000000000000..edbd58f26c8235 --- /dev/null +++ b/staging/staging-et131x-kill-the-space_avail-type.patch @@ -0,0 +1,67 @@ +From alan@linux.intel.com Wed Jan 27 15:45:39 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:13 +0000 +Subject: Staging: et131x: Kill the SPACE_AVAIL type +To: greg@kroah.com +Message-ID: <20100118153513.6884.41998.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 23 ++++++----------------- + drivers/staging/et131x/et1310_mac.c | 2 +- + 2 files changed, 7 insertions(+), 18 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -873,23 +873,12 @@ typedef union _RXMAC_UNI_PF_ADDR3_t { + /* + * structure for space availiable reg in rxmac address map. + * located at address 0x4094 ++ * ++ * 31-17: reserved ++ * 16: space_avail_en ++ * 15-10: reserved ++ * 9-0: space_avail + */ +-typedef union _RXMAC_SPACE_AVAIL_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved2:15; /* bits 17-31 */ +- u32 space_avail_en:1; /* bit 16 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 space_avail:10; /* bits 0-9 */ +-#else +- u32 space_avail:10; /* bits 0-9 */ +- u32 reserved1:6; /* bits 10-15 */ +- u32 space_avail_en:1; /* bit 16 */ +- u32 reserved2:15; /* bits 17-31 */ +-#endif +- } bits; +-} RXMAC_SPACE_AVAIL_t, *PRXMAC_SPACE_AVAIL_t; + + /* + * structure for management interface reg in rxmac address map. +@@ -974,7 +963,7 @@ typedef struct _RXMAC_t { /* Location + u32 mcif_ctrl_max_seg; /* 0x4088 */ + u32 mcif_water_mark; /* 0x408C */ + u32 rxq_diag; /* 0x4090 */ +- RXMAC_SPACE_AVAIL_t space_avail; /* 0x4094 */ ++ u32 space_avail; /* 0x4094 */ + + RXMAC_MIF_CTL_t mif_ctrl; /* 0x4098 */ + RXMAC_ERROR_REG_t err_reg; /* 0x409C */ +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -336,7 +336,7 @@ void ConfigRxMacRegs(struct et131x_adapt + writel(0, &pRxMac->mif_ctrl.value); + + /* Initialize the Space Available Register */ +- writel(0, &pRxMac->space_avail.value); ++ writel(0, &pRxMac->space_avail); + + /* Initialize the the mif_ctrl register + * bit 3: Receive code error. One or more nibbles were signaled as diff --git a/staging/staging-et131x-kill-txmac-err-count-typedef.patch b/staging/staging-et131x-kill-txmac-err-count-typedef.patch new file mode 100644 index 00000000000000..5bdf02a3e0ad15 --- /dev/null +++ b/staging/staging-et131x-kill-txmac-err-count-typedef.patch @@ -0,0 +1,55 @@ +From alan@linux.intel.com Wed Jan 27 15:44:40 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:35 +0000 +Subject: Staging: et131x: kill txmac err count typedef +To: greg@kroah.com +Message-ID: <20100118153435.6884.56141.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 23 ++++++----------------- + 1 file changed, 6 insertions(+), 17 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -563,23 +563,12 @@ struct rxdma_regs { /* Location: */ + /* + * structure for error count reg in txmac address map + * located at address 0x3008 ++ * ++ * 31-12: unused ++ * 11-8: reserved ++ * 7-4: txq_underrun ++ * 3-0: fifo_underrun + */ +-typedef union _TXMAC_ERR_CNT_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused:20; /* bits 12-31 */ +- u32 reserved:4; /* bits 8-11 */ +- u32 txq_underrun:4; /* bits 4-7 */ +- u32 fifo_underrun:4; /* bits 0-3 */ +-#else +- u32 fifo_underrun:4; /* bits 0-3 */ +- u32 txq_underrun:4; /* bits 4-7 */ +- u32 reserved:4; /* bits 8-11 */ +- u32 unused:20; /* bits 12-31 */ +-#endif +- } bits; +-} TXMAC_ERR_CNT_t, *PTXMAC_ERR_CNT_t; + + /* + * structure for max fill reg in txmac address map +@@ -682,7 +671,7 @@ typedef union _TXMAC_ERR_INT_t { + typedef struct _TXMAC_t { /* Location: */ + u32 ctl; /* 0x3000 */ + u32 shadow_ptr; /* 0x3004 */ +- TXMAC_ERR_CNT_t err_cnt; /* 0x3008 */ ++ u32 err_cnt; /* 0x3008 */ + u32 max_fill; /* 0x300C */ + u32 cf_param; /* 0x3010 */ + u32 tx_test; /* 0x3014 */ diff --git a/staging/staging-et131x-kill-unused-error-defines.patch b/staging/staging-et131x-kill-unused-error-defines.patch new file mode 100644 index 00000000000000..9481edfbd06771 --- /dev/null +++ b/staging/staging-et131x-kill-unused-error-defines.patch @@ -0,0 +1,43 @@ +From alan@linux.intel.com Wed Jan 27 15:44:07 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:18 +0000 +Subject: Staging: et131x: Kill unused error defines +To: greg@kroah.com +Message-ID: <20100118153418.6884.27609.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et131x_adapter.h | 18 ------------------ + 1 file changed, 18 deletions(-) + +--- a/drivers/staging/et131x/et131x_adapter.h ++++ b/drivers/staging/et131x/et131x_adapter.h +@@ -77,25 +77,7 @@ + */ + #define NUM_TRAFFIC_CLASSES 1 + +-/* +- * There are three ways of counting errors - if there are more than X errors +- * in Y packets (represented by the "SAMPLE" macros), if there are more than +- * N errors in a S mSec time period (the "PERIOD" macros), or if there are +- * consecutive packets with errors (CONSEC_ERRORED_THRESH). This last covers +- * for "Bursty" errors, and the errored packets may well not be contiguous, +- * but several errors where the packet counter has changed by less than a +- * small amount will cause this count to increment. +- */ +-#define TX_PACKETS_IN_SAMPLE 10000 +-#define TX_MAX_ERRORS_IN_SAMPLE 50 +- + #define TX_ERROR_PERIOD 1000 +-#define TX_MAX_ERRORS_IN_PERIOD 10 +- +-#define LINK_DETECTION_TIMER 5000 +- +-#define TX_CONSEC_RANGE 5 +-#define TX_CONSEC_ERRORED_THRESH 10 + + #define LO_MARK_PERCENT_FOR_PSR 15 + #define LO_MARK_PERCENT_FOR_RX 15 diff --git a/staging/staging-et131x-rx_status_block_t-is-now-clean.patch b/staging/staging-et131x-rx_status_block_t-is-now-clean.patch new file mode 100644 index 00000000000000..a8a86653cc7a40 --- /dev/null +++ b/staging/staging-et131x-rx_status_block_t-is-now-clean.patch @@ -0,0 +1,87 @@ +From alan@linux.intel.com Wed Jan 27 15:43:23 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:33:45 +0000 +Subject: Staging: et131x: rx_status_block_t is now clean +To: greg@kroah.com +Message-ID: <20100118153345.6884.6457.stgit@localhost.localdomain> + + +So kill off the top level type and turn it into a struct + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_rx.c | 12 ++++++------ + drivers/staging/et131x/et1310_rx.h | 8 ++++---- + 2 files changed, 10 insertions(+), 10 deletions(-) + +--- a/drivers/staging/et131x/et1310_rx.c ++++ b/drivers/staging/et131x/et1310_rx.c +@@ -361,8 +361,8 @@ int et131x_rx_dma_memory_alloc(struct et + + /* Allocate an area of memory for writeback of status information */ + rx_ring->pRxStatusVa = pci_alloc_consistent(adapter->pdev, +- sizeof(RX_STATUS_BLOCK_t), +- &rx_ring->pRxStatusPa); ++ sizeof(struct rx_status_block), ++ &rx_ring->pRxStatusPa); + if (!rx_ring->pRxStatusVa) { + dev_err(&adapter->pdev->dev, + "Cannot alloc memory for Status Block\n"); +@@ -508,7 +508,7 @@ void et131x_rx_dma_memory_free(struct et + /* Free area of memory for the writeback of status information */ + if (rx_ring->pRxStatusVa) { + pci_free_consistent(adapter->pdev, +- sizeof(RX_STATUS_BLOCK_t), ++ sizeof(struct rx_status_block), + rx_ring->pRxStatusVa, rx_ring->pRxStatusPa); + + rx_ring->pRxStatusVa = NULL; +@@ -614,7 +614,7 @@ void ConfigRxDmaRegs(struct et131x_adapt + &rx_dma->dma_wb_base_hi); + writel((u32) rx_local->pRxStatusPa, &rx_dma->dma_wb_base_lo); + +- memset(rx_local->pRxStatusVa, 0, sizeof(RX_STATUS_BLOCK_t)); ++ memset(rx_local->pRxStatusVa, 0, sizeof(struct rx_status_block)); + + /* Set the address and parameters of the packet status ring into the + * 1310's registers +@@ -786,7 +786,7 @@ void et131x_rx_dma_enable(struct et131x_ + PMP_RFD nic_rx_pkts(struct et131x_adapter *etdev) + { + struct _rx_ring_t *rx_local = &etdev->RxRing; +- PRX_STATUS_BLOCK_t status; ++ struct rx_status_block *status; + PPKT_STAT_DESC_t psr; + PMP_RFD rfd; + u32 i; +@@ -803,7 +803,7 @@ PMP_RFD nic_rx_pkts(struct et131x_adapte + * interrupt. It contains the next to be used entry in the Packet + * Status Ring, and also the two Free Buffer rings. + */ +- status = (PRX_STATUS_BLOCK_t) rx_local->pRxStatusVa; ++ status = (struct rx_status_block *)rx_local->pRxStatusVa; + word1 = status->Word1 >> 16; /* Get the useful bits */ + + /* Check the PSR and wrap bits do not match */ +--- a/drivers/staging/et131x/et1310_rx.h ++++ b/drivers/staging/et131x/et1310_rx.h +@@ -219,13 +219,13 @@ typedef struct _PKT_STAT_DESC_t { + */ + + /* +- * RX_STATUS_BLOCK_t is sructure representing the status of the Rx DMA engine +- * it sits in free memory, and is pointed to by 0x101c / 0x1020 ++ * struct rx_status_block is a structure representing the status of the Rx ++ * DMA engine it sits in free memory, and is pointed to by 0x101c / 0x1020 + */ +-typedef struct _rx_status_block_t { ++struct rx_status_block { + u32 Word0; + u32 Word1; +-} RX_STATUS_BLOCK_t, *PRX_STATUS_BLOCK_t; ++}; + + /* + * Structure for look-up table holding free buffer ring pointers diff --git a/staging/staging-et131x_kill-mac_stat_t.patch b/staging/staging-et131x_kill-mac_stat_t.patch new file mode 100644 index 00000000000000..d1495b98b55235 --- /dev/null +++ b/staging/staging-et131x_kill-mac_stat_t.patch @@ -0,0 +1,76 @@ +From alan@linux.intel.com Wed Jan 27 15:46:11 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:35:35 +0000 +Subject: Staging: et131x_kill MAC_STAT_t +To: greg@kroah.com +Message-ID: <20100118153535.6884.3454.stgit@localhost.localdomain> + + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 44 ++++++++-------------------- + 1 file changed, 13 insertions(+), 31 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -1106,37 +1106,19 @@ typedef struct _RXMAC_t { /* Location + /* + * structure for Interface Status reg in mac address map. + * located at address 0x503C ++ * ++ * 31-10: reserved ++ * 9: excess_defer ++ * 8: clash ++ * 7: phy_jabber ++ * 6: phy_link_ok ++ * 5: phy_full_duplex ++ * 4: phy_speed ++ * 3: pe100x_link_fail ++ * 2: pe10t_loss_carrier ++ * 1: pe10t_sqe_error ++ * 0: pe10t_jabber + */ +-typedef union _MAC_IF_STAT_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 reserved:22; /* bits 10-31 */ +- u32 excess_defer:1; /* bit 9 */ +- u32 clash:1; /* bit 8 */ +- u32 phy_jabber:1; /* bit 7 */ +- u32 phy_link_ok:1; /* bit 6 */ +- u32 phy_full_duplex:1; /* bit 5 */ +- u32 phy_speed:1; /* bit 4 */ +- u32 pe100x_link_fail:1; /* bit 3 */ +- u32 pe10t_loss_carrie:1; /* bit 2 */ +- u32 pe10t_sqe_error:1; /* bit 1 */ +- u32 pe10t_jabber:1; /* bit 0 */ +-#else +- u32 pe10t_jabber:1; /* bit 0 */ +- u32 pe10t_sqe_error:1; /* bit 1 */ +- u32 pe10t_loss_carrie:1; /* bit 2 */ +- u32 pe100x_link_fail:1; /* bit 3 */ +- u32 phy_speed:1; /* bit 4 */ +- u32 phy_full_duplex:1; /* bit 5 */ +- u32 phy_link_ok:1; /* bit 6 */ +- u32 phy_jabber:1; /* bit 7 */ +- u32 clash:1; /* bit 8 */ +- u32 excess_defer:1; /* bit 9 */ +- u32 reserved:22; /* bits 10-31 */ +-#endif +- } bits; +-} MAC_IF_STAT_t, *PMAC_IF_STAT_t; + + /* + * structure for Mac Station Address, Part 1 reg in mac address map. +@@ -1197,7 +1179,7 @@ typedef struct _MAC_t { /* Location: + u32 mii_mgmt_stat; /* 0x5030 */ + u32 mii_mgmt_indicator; /* 0x5034 */ + u32 if_ctrl; /* 0x5038 */ +- MAC_IF_STAT_t if_stat; /* 0x503C */ ++ u32 if_stat; /* 0x503C */ + MAC_STATION_ADDR1_t station_addr_1; /* 0x5040 */ + MAC_STATION_ADDR2_t station_addr_2; /* 0x5044 */ + } MAC_t, *PMAC_t; diff --git a/staging/staging-et13x-kill-off-txmac_err_int_t.patch b/staging/staging-et13x-kill-off-txmac_err_int_t.patch new file mode 100644 index 00000000000000..eefc0f23d2559a --- /dev/null +++ b/staging/staging-et13x-kill-off-txmac_err_int_t.patch @@ -0,0 +1,130 @@ +From alan@linux.intel.com Wed Jan 27 15:44:55 2010 +From: Alan Cox <alan@linux.intel.com> +Date: Mon, 18 Jan 2010 15:34:46 +0000 +Subject: Staging: et13x: kill off TXMAC_ERR_INT_t +To: greg@kroah.com +Message-ID: <20100118153446.6884.86556.stgit@localhost.localdomain> + + +This completes the structures within the txmac block so we can now +propogate a name change and type removal up a layer and clean up TXMAC as +well + +Signed-off-by: Alan Cox <alan@linux.intel.com> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/et131x/et1310_address_map.h | 48 +++++++++------------------- + drivers/staging/et131x/et1310_mac.c | 6 +-- + 2 files changed, 19 insertions(+), 35 deletions(-) + +--- a/drivers/staging/et131x/et1310_address_map.h ++++ b/drivers/staging/et131x/et1310_address_map.h +@@ -612,33 +612,17 @@ struct rxdma_regs { /* Location: */ + /* + * structure for error interrupt reg in txmac address map + * located at address 0x301C ++ * ++ * 31-9: unused ++ * 8: fifo_underrun ++ * 7-6: unused ++ * 5: ctrl2_err ++ * 4: txq_underrun ++ * 3: bcnt_err ++ * 2: lseg_err ++ * 1: segnum_err ++ * 0: seg0_err + */ +-typedef union _TXMAC_ERR_INT_t { +- u32 value; +- struct { +-#ifdef _BIT_FIELDS_HTOL +- u32 unused2:23; /* bits 9-31 */ +- u32 fifo_underrun:1; /* bit 8 */ +- u32 unused1:2; /* bits 6-7 */ +- u32 ctrl2_err:1; /* bit 5 */ +- u32 txq_underrun:1; /* bit 4 */ +- u32 bcnt_err:1; /* bit 3 */ +- u32 lseg_err:1; /* bit 2 */ +- u32 segnum_err:1; /* bit 1 */ +- u32 seg0_err:1; /* bit 0 */ +-#else +- u32 seg0_err:1; /* bit 0 */ +- u32 segnum_err:1; /* bit 1 */ +- u32 lseg_err:1; /* bit 2 */ +- u32 bcnt_err:1; /* bit 3 */ +- u32 txq_underrun:1; /* bit 4 */ +- u32 ctrl2_err:1; /* bit 5 */ +- u32 unused1:2; /* bits 6-7 */ +- u32 fifo_underrun:1; /* bit 8 */ +- u32 unused2:23; /* bits 9-31 */ +-#endif +- } bits; +-} TXMAC_ERR_INT_t, *PTXMAC_ERR_INT_t; + + /* + * structure for error interrupt reg in txmac address map +@@ -652,7 +636,7 @@ typedef union _TXMAC_ERR_INT_t { + /* + * Tx MAC Module of JAGCore Address Mapping + */ +-typedef struct _TXMAC_t { /* Location: */ ++struct txmac_regs { /* Location: */ + u32 ctl; /* 0x3000 */ + u32 shadow_ptr; /* 0x3004 */ + u32 err_cnt; /* 0x3008 */ +@@ -660,9 +644,9 @@ typedef struct _TXMAC_t { /* Location: + u32 cf_param; /* 0x3010 */ + u32 tx_test; /* 0x3014 */ + u32 err; /* 0x3018 */ +- TXMAC_ERR_INT_t err_int; /* 0x301C */ ++ u32 err_int; /* 0x301C */ + u32 bp_ctrl; /* 0x3020 */ +-} TXMAC_t, *PTXMAC_t; ++}; + + /* END OF TXMAC REGISTER ADDRESS MAP */ + +@@ -1087,7 +1071,7 @@ typedef struct _RXMAC_t { /* Location + RXMAC_ERROR_REG_t err_reg; /* 0x409C */ + } RXMAC_t, *PRXMAC_t; + +-/* END OF TXMAC REGISTER ADDRESS MAP */ ++/* END OF RXMAC REGISTER ADDRESS MAP */ + + + /* START OF MAC REGISTER ADDRESS MAP */ +@@ -1632,9 +1616,9 @@ typedef struct _ADDRESS_MAP_t { + struct rxdma_regs rxdma; + /* unused section of rxdma address map */ + u8 unused_rxdma[4096 - sizeof(struct rxdma_regs)]; +- TXMAC_t txmac; ++ struct txmac_regs txmac; + /* unused section of txmac address map */ +- u8 unused_txmac[4096 - sizeof(TXMAC_t)]; ++ u8 unused_txmac[4096 - sizeof(struct txmac_regs)]; + RXMAC_t rxmac; + /* unused section of rxmac address map */ + u8 unused_rxmac[4096 - sizeof(RXMAC_t)]; +--- a/drivers/staging/et131x/et1310_mac.c ++++ b/drivers/staging/et131x/et1310_mac.c +@@ -376,16 +376,16 @@ void ConfigRxMacRegs(struct et131x_adapt + + void ConfigTxMacRegs(struct et131x_adapter *etdev) + { +- struct _TXMAC_t __iomem *pTxMac = &etdev->regs->txmac; ++ struct txmac_regs *txmac = &etdev->regs->txmac; + + /* We need to update the Control Frame Parameters + * cfpt - control frame pause timer set to 64 (0x40) + * cfep - control frame extended pause timer set to 0x0 + */ + if (etdev->FlowControl == None) +- writel(0, &pTxMac->cf_param); ++ writel(0, &txmac->cf_param); + else +- writel(0x40, &pTxMac->cf_param); ++ writel(0x40, &txmac->cf_param); + } + + void ConfigMacStatRegs(struct et131x_adapter *etdev) diff --git a/staging/staging-hv-remove-xen-legacy-code-and-check-for-hyper-v.patch b/staging/staging-hv-remove-xen-legacy-code-and-check-for-hyper-v.patch new file mode 100644 index 00000000000000..5457002b837374 --- /dev/null +++ b/staging/staging-hv-remove-xen-legacy-code-and-check-for-hyper-v.patch @@ -0,0 +1,334 @@ +From hjanssen@microsoft.com Wed Jan 27 15:58:30 2010 +From: Hank Janssen <hjanssen@microsoft.com> +Date: Fri, 22 Jan 2010 19:17:50 +0000 +Subject: Staging: hv: Remove xen legacy code and check for Hyper-V +Cc: Haiyang Zhang <haiyangz@microsoft.com>, "gregkh@suse.de" <gregkh@suse.de> +Message-ID: <8AFC7968D54FB448A30D8F38F259C5620E878FE0@TK5EX14MBXC118.redmond.corp.microsoft.com> + +Removed legacy XEN layer from hypervisor setup, and made sure only +Hyper-V is Is a valid hypervisor to run on. + +Signed-off-by: Hank Janssen <hjanssen@microsoft.com> +Cc: Haiyang Zhang <haiyangz@microsoft.com>. +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/staging/hv/Hv.c | 215 +++++++++++++++++++----------------------------- + drivers/staging/hv/Hv.h | 10 -- + 2 files changed, 89 insertions(+), 136 deletions(-) + +--- a/drivers/staging/hv/Hv.c ++++ b/drivers/staging/hv/Hv.c +@@ -208,50 +208,51 @@ int HvInit(void) + /* HvQueryHypervisorFeatures(maxLeaf); */ + + /* +- * Determine if we are running on xenlinux (ie x2v shim) or native +- * linux ++ * We only support running on top of Hyper-V + */ + rdmsrl(HV_X64_MSR_GUEST_OS_ID, gHvContext.GuestId); +- if (gHvContext.GuestId == 0) { +- /* Write our OS info */ +- wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); +- gHvContext.GuestId = HV_LINUX_GUEST_ID; ++ ++ if (gHvContext.GuestId != 0) { ++ DPRINT_ERR(VMBUS, "Unknown guest id (0x%llx)!!", ++ gHvContext.GuestId); ++ goto Cleanup; + } + ++ /* Write our OS info */ ++ wrmsrl(HV_X64_MSR_GUEST_OS_ID, HV_LINUX_GUEST_ID); ++ gHvContext.GuestId = HV_LINUX_GUEST_ID; ++ + /* See if the hypercall page is already set */ + rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); +- if (gHvContext.GuestId == HV_LINUX_GUEST_ID) { +- /* Allocate the hypercall page memory */ +- /* virtAddr = osd_PageAlloc(1); */ +- virtAddr = osd_VirtualAllocExec(PAGE_SIZE); +- +- if (!virtAddr) { +- DPRINT_ERR(VMBUS, +- "unable to allocate hypercall page!!"); +- goto Cleanup; +- } + +- hypercallMsr.Enable = 1; +- /* hypercallMsr.GuestPhysicalAddress = +- * virt_to_phys(virtAddr) >> PAGE_SHIFT; */ +- hypercallMsr.GuestPhysicalAddress = vmalloc_to_pfn(virtAddr); +- wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ /* ++ * Allocate the hypercall page memory ++ * virtAddr = osd_PageAlloc(1); ++ */ ++ virtAddr = osd_VirtualAllocExec(PAGE_SIZE); ++ ++ if (!virtAddr) { ++ DPRINT_ERR(VMBUS, ++ "unable to allocate hypercall page!!"); ++ goto Cleanup; ++ } + +- /* Confirm that hypercall page did get setup. */ +- hypercallMsr.AsUINT64 = 0; +- rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); +- if (!hypercallMsr.Enable) { +- DPRINT_ERR(VMBUS, "unable to set hypercall page!!"); +- goto Cleanup; +- } ++ hypercallMsr.Enable = 1; + +- gHvContext.HypercallPage = virtAddr; +- } else { +- DPRINT_ERR(VMBUS, "Unknown guest id (0x%llx)!!", +- gHvContext.GuestId); ++ hypercallMsr.GuestPhysicalAddress = vmalloc_to_pfn(virtAddr); ++ wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ ++ /* Confirm that hypercall page did get setup. */ ++ hypercallMsr.AsUINT64 = 0; ++ rdmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ ++ if (!hypercallMsr.Enable) { ++ DPRINT_ERR(VMBUS, "unable to set hypercall page!!"); + goto Cleanup; + } + ++ gHvContext.HypercallPage = virtAddr; ++ + DPRINT_INFO(VMBUS, "Hypercall page VA=%p, PA=0x%0llx", + gHvContext.HypercallPage, + (u64)hypercallMsr.GuestPhysicalAddress << PAGE_SHIFT); +@@ -273,8 +274,6 @@ int HvInit(void) + gHvContext.SignalEventParam->FlagNumber = 0; + gHvContext.SignalEventParam->RsvdZ = 0; + +- /* DPRINT_DBG(VMBUS, "My id %llu", HvGetCurrentPartitionId()); */ +- + DPRINT_EXIT(VMBUS); + + return ret; +@@ -311,17 +310,14 @@ void HvCleanup(void) + kfree(gHvContext.SignalEventBuffer); + } + +- if (gHvContext.GuestId == HV_LINUX_GUEST_ID) { +- if (gHvContext.HypercallPage) { +- hypercallMsr.AsUINT64 = 0; +- wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); +- vfree(gHvContext.HypercallPage); +- gHvContext.HypercallPage = NULL; +- } ++ if (gHvContext.HypercallPage) { ++ hypercallMsr.AsUINT64 = 0; ++ wrmsrl(HV_X64_MSR_HYPERCALL, hypercallMsr.AsUINT64); ++ vfree(gHvContext.HypercallPage); ++ gHvContext.HypercallPage = NULL; + } + + DPRINT_EXIT(VMBUS); +- + } + + /** +@@ -393,7 +389,7 @@ void HvSynicInit(void *irqarg) + union hv_synic_siefp siefp; + union hv_synic_sint sharedSint; + union hv_synic_scontrol sctrl; +- u64 guestID; ++ + u32 irqVector = *((u32 *)(irqarg)); + int cpu = smp_processor_id(); + +@@ -409,72 +405,42 @@ void HvSynicInit(void *irqarg) + + DPRINT_INFO(VMBUS, "SynIC version: %llx", version); + +- /* TODO: Handle SMP */ +- if (gHvContext.GuestId == HV_XENLINUX_GUEST_ID) { +- DPRINT_INFO(VMBUS, "Skipping SIMP and SIEFP setup since " +- "it is already set."); +- +- rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); +- rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); +- +- DPRINT_DBG(VMBUS, "Simp: %llx, Sifep: %llx", +- simp.AsUINT64, siefp.AsUINT64); +- +- /* +- * Determine if we are running on xenlinux (ie x2v shim) or +- * native linux +- */ +- rdmsrl(HV_X64_MSR_GUEST_OS_ID, guestID); +- if (guestID == HV_LINUX_GUEST_ID) { +- gHvContext.synICMessagePage[cpu] = +- phys_to_virt(simp.BaseSimpGpa << PAGE_SHIFT); +- gHvContext.synICEventPage[cpu] = +- phys_to_virt(siefp.BaseSiefpGpa << PAGE_SHIFT); +- } else { +- DPRINT_ERR(VMBUS, "unknown guest id!!"); +- goto Cleanup; +- } +- DPRINT_DBG(VMBUS, "MAPPED: Simp: %p, Sifep: %p", +- gHvContext.synICMessagePage[cpu], +- gHvContext.synICEventPage[cpu]); +- } else { +- gHvContext.synICMessagePage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); +- if (gHvContext.synICMessagePage[cpu] == NULL) { +- DPRINT_ERR(VMBUS, +- "unable to allocate SYNIC message page!!"); +- goto Cleanup; +- } +- +- gHvContext.synICEventPage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); +- if (gHvContext.synICEventPage[cpu] == NULL) { +- DPRINT_ERR(VMBUS, +- "unable to allocate SYNIC event page!!"); +- goto Cleanup; +- } ++ gHvContext.synICMessagePage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); + +- /* Setup the Synic's message page */ +- rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); +- simp.SimpEnabled = 1; +- simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[cpu]) +- >> PAGE_SHIFT; +- +- DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", +- simp.AsUINT64); +- +- wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); +- +- /* Setup the Synic's event page */ +- rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); +- siefp.SiefpEnabled = 1; +- siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[cpu]) +- >> PAGE_SHIFT; ++ if (gHvContext.synICMessagePage[cpu] == NULL) { ++ DPRINT_ERR(VMBUS, ++ "unable to allocate SYNIC message page!!"); ++ goto Cleanup; ++ } + +- DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", +- siefp.AsUINT64); ++ gHvContext.synICEventPage[cpu] = (void *)get_zeroed_page(GFP_ATOMIC); + +- wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ if (gHvContext.synICEventPage[cpu] == NULL) { ++ DPRINT_ERR(VMBUS, ++ "unable to allocate SYNIC event page!!"); ++ goto Cleanup; + } + ++ /* Setup the Synic's message page */ ++ rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); ++ simp.SimpEnabled = 1; ++ simp.BaseSimpGpa = virt_to_phys(gHvContext.synICMessagePage[cpu]) ++ >> PAGE_SHIFT; ++ ++ DPRINT_DBG(VMBUS, "HV_X64_MSR_SIMP msr set to: %llx", simp.AsUINT64); ++ ++ wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); ++ ++ /* Setup the Synic's event page */ ++ rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ siefp.SiefpEnabled = 1; ++ siefp.BaseSiefpGpa = virt_to_phys(gHvContext.synICEventPage[cpu]) ++ >> PAGE_SHIFT; ++ ++ DPRINT_DBG(VMBUS, "HV_X64_MSR_SIEFP msr set to: %llx", siefp.AsUINT64); ++ ++ wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ + /* Setup the interception SINT. */ + /* wrmsrl((HV_X64_MSR_SINT0 + HV_SYNIC_INTERCEPTION_SINT_INDEX), */ + /* interceptionSint.AsUINT64); */ +@@ -505,13 +471,11 @@ void HvSynicInit(void *irqarg) + return; + + Cleanup: +- if (gHvContext.GuestId == HV_LINUX_GUEST_ID) { +- if (gHvContext.synICEventPage[cpu]) +- osd_PageFree(gHvContext.synICEventPage[cpu], 1); ++ if (gHvContext.synICEventPage[cpu]) ++ osd_PageFree(gHvContext.synICEventPage[cpu], 1); + +- if (gHvContext.synICMessagePage[cpu]) +- osd_PageFree(gHvContext.synICMessagePage[cpu], 1); +- } ++ if (gHvContext.synICMessagePage[cpu]) ++ osd_PageFree(gHvContext.synICMessagePage[cpu], 1); + + DPRINT_EXIT(VMBUS); + return; +@@ -542,27 +506,20 @@ void HvSynicCleanup(void *arg) + /* Disable the interrupt */ + wrmsrl(HV_X64_MSR_SINT0 + VMBUS_MESSAGE_SINT, sharedSint.AsUINT64); + +- /* +- * Disable and free the resources only if we are running as +- * native linux since in xenlinux, we are sharing the +- * resources with the x2v shim +- */ +- if (gHvContext.GuestId == HV_LINUX_GUEST_ID) { +- rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); +- simp.SimpEnabled = 0; +- simp.BaseSimpGpa = 0; +- +- wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); +- +- rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); +- siefp.SiefpEnabled = 0; +- siefp.BaseSiefpGpa = 0; ++ rdmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); ++ simp.SimpEnabled = 0; ++ simp.BaseSimpGpa = 0; + +- wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ wrmsrl(HV_X64_MSR_SIMP, simp.AsUINT64); + +- osd_PageFree(gHvContext.synICMessagePage[cpu], 1); +- osd_PageFree(gHvContext.synICEventPage[cpu], 1); +- } ++ rdmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ siefp.SiefpEnabled = 0; ++ siefp.BaseSiefpGpa = 0; ++ ++ wrmsrl(HV_X64_MSR_SIEFP, siefp.AsUINT64); ++ ++ osd_PageFree(gHvContext.synICMessagePage[cpu], 1); ++ osd_PageFree(gHvContext.synICEventPage[cpu], 1); + + DPRINT_EXIT(VMBUS); + } +--- a/drivers/staging/hv/Hv.h ++++ b/drivers/staging/hv/Hv.h +@@ -41,11 +41,6 @@ enum { + + #define HV_PRESENT_BIT 0x80000000 + +-#define HV_XENLINUX_GUEST_ID_LO 0x00000000 +-#define HV_XENLINUX_GUEST_ID_HI 0x0B00B135 +-#define HV_XENLINUX_GUEST_ID (((u64)HV_XENLINUX_GUEST_ID_HI << 32) \ +- | HV_XENLINUX_GUEST_ID_LO) +- + #define HV_LINUX_GUEST_ID_LO 0x00000000 + #define HV_LINUX_GUEST_ID_HI 0xB16B00B5 + #define HV_LINUX_GUEST_ID (((u64)HV_LINUX_GUEST_ID_HI << 32) | \ +@@ -102,8 +97,9 @@ struct hv_input_signal_event_buffer { + }; + + struct hv_context { +- /* XenLinux or native Linux. If XenLinux, the hypercall and synic pages +- * has already been initialized */ ++ /* We only support running on top of Hyper-V ++ * So at this point this really can only contain the Hyper-V ID ++ */ + u64 GuestId; + + void *HypercallPage; diff --git a/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch b/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch new file mode 100644 index 00000000000000..c52bfca286194c --- /dev/null +++ b/usb.current/kfifo-don-t-use-integer-as-null-pointer.patch @@ -0,0 +1,47 @@ +From avorontsov@ru.mvista.com Wed Jan 27 16:00:42 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:38 +0300 +Subject: kfifo: Don't use integer as NULL pointer +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140938.GC31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +This patch fixes following sparse warnings: + +include/linux/kfifo.h:127:25: warning: Using plain integer as NULL pointer +kernel/kfifo.c:83:21: warning: Using plain integer as NULL pointer + +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + include/linux/kfifo.h | 2 +- + kernel/kfifo.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +--- a/include/linux/kfifo.h ++++ b/include/linux/kfifo.h +@@ -124,7 +124,7 @@ extern __must_check unsigned int kfifo_o + */ + static inline bool kfifo_initialized(struct kfifo *fifo) + { +- return fifo->buffer != 0; ++ return fifo->buffer != NULL; + } + + /** +--- a/kernel/kfifo.c ++++ b/kernel/kfifo.c +@@ -80,7 +80,7 @@ int kfifo_alloc(struct kfifo *fifo, unsi + + buffer = kmalloc(size, gfp_mask); + if (!buffer) { +- _kfifo_init(fifo, 0, 0); ++ _kfifo_init(fifo, NULL, 0); + return -ENOMEM; + } + diff --git a/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch b/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch new file mode 100644 index 00000000000000..2121e50948e0a3 --- /dev/null +++ b/usb.current/kfifo-make-kfifo_initialized-work-after-kfifo_free.patch @@ -0,0 +1,35 @@ +From avorontsov@ru.mvista.com Wed Jan 27 15:59:32 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:34 +0300 +Subject: kfifo: Make kfifo_initialized work after kfifo_free +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140934.GA31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +After kfifo rework it's no longer possible to reliably know if kfifo is +usable, since after kfifo_free(), kfifo_initialized() would still return +true. The correct behaviour is needed for at least FHCI USB driver. + +This patch fixes the issue by resetting the kfifo to zero values (the +same approach is used in kfifo_alloc() if allocation failed). + +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + kernel/kfifo.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/kernel/kfifo.c ++++ b/kernel/kfifo.c +@@ -97,6 +97,7 @@ EXPORT_SYMBOL(kfifo_alloc); + void kfifo_free(struct kfifo *fifo) + { + kfree(fifo->buffer); ++ _kfifo_init(fifo, NULL, 0); + } + EXPORT_SYMBOL(kfifo_free); + diff --git a/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch b/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch new file mode 100644 index 00000000000000..74db03f185fa1b --- /dev/null +++ b/usb.current/usb-fhci-fix-build-after-kfifo-rework.patch @@ -0,0 +1,61 @@ +From avorontsov@ru.mvista.com Wed Jan 27 15:59:56 2010 +From: Anton Vorontsov <avorontsov@ru.mvista.com> +Date: Wed, 27 Jan 2010 17:09:36 +0300 +Subject: USB: FHCI: Fix build after kfifo rework +To: Andrew Morton <akpm@linux-foundation.org> +Cc: Greg Kroah-Hartman <gregkh@suse.de>, Josh Boyer <jwboyer@gmail.com>, Stefani Seibold <stefani@seibold.net>, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org +Message-ID: <20100127140936.GB31608@oksana.dev.rtsoft.ru> +Content-Disposition: inline + + +After kfifo rework FHCI fails to build: + + CC drivers/usb/host/fhci-tds.o +drivers/usb/host/fhci-tds.c: In function 'fhci_ep0_free': +drivers/usb/host/fhci-tds.c:108: error: used struct type value where scalar is required +drivers/usb/host/fhci-tds.c:118: error: used struct type value where scalar is required +drivers/usb/host/fhci-tds.c:128: error: used struct type value where scalar is required + +This is because kfifos are no longer pointers in the ep struct. +So, instead of checking the pointers, we should now check if kfifo +is initialized. + +Reported-by: Josh Boyer <jwboyer@gmail.com> +Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> +Acked-by: Stefani Seibold <stefani@seibold.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/host/fhci-tds.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/usb/host/fhci-tds.c ++++ b/drivers/usb/host/fhci-tds.c +@@ -105,7 +105,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + if (ep->td_base) + cpm_muram_free(cpm_muram_offset(ep->td_base)); + +- if (ep->conf_frame_Q) { ++ if (kfifo_initialized(&ep->conf_frame_Q)) { + size = cq_howmany(&ep->conf_frame_Q); + for (; size; size--) { + struct packet *pkt = cq_get(&ep->conf_frame_Q); +@@ -115,7 +115,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + cq_delete(&ep->conf_frame_Q); + } + +- if (ep->empty_frame_Q) { ++ if (kfifo_initialized(&ep->empty_frame_Q)) { + size = cq_howmany(&ep->empty_frame_Q); + for (; size; size--) { + struct packet *pkt = cq_get(&ep->empty_frame_Q); +@@ -125,7 +125,7 @@ void fhci_ep0_free(struct fhci_usb *usb) + cq_delete(&ep->empty_frame_Q); + } + +- if (ep->dummy_packets_Q) { ++ if (kfifo_initialized(&ep->dummy_packets_Q)) { + size = cq_howmany(&ep->dummy_packets_Q); + for (; size; size--) { + u8 *buff = cq_get(&ep->dummy_packets_Q); |
