diff options
author | Sandeep Gopalpet <Sandeep.Kumar@freescale.com> | 2009-11-02 02:03:09 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-03 02:40:56 -0500 |
commit | f4983704a63b3764418905a77d48105a8cbce97f (patch) | |
tree | 959183e305131f60e01f0452e87f1f80a580abea /drivers/net/gianfar.h | |
parent | a12f801d4b349bc57622584e70e45a4ccbef53b6 (diff) |
gianfar: Introduce logical group support.
This patch introduces the group structure. The elements of this
structure are the interrupt lines, their corresponding names,
the register memory map.
The elements for this group are factored out from the gfar_private
structure. The introduction of group structure will help in
providing support for newer versions of etsec.
Currently, the support is present only for single group and
single tx/rx queues.
Signed-off-by: Sandeep Gopalpet <Sandeep.Kumar@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/gianfar.h')
-rw-r--r-- | drivers/net/gianfar.h | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/drivers/net/gianfar.h b/drivers/net/gianfar.h index a60f93f1ae07..79e8471584ea 100644 --- a/drivers/net/gianfar.h +++ b/drivers/net/gianfar.h | |||
@@ -770,6 +770,32 @@ struct gfar_priv_rx_q { | |||
770 | unsigned long rxic; | 770 | unsigned long rxic; |
771 | }; | 771 | }; |
772 | 772 | ||
773 | /** | ||
774 | * struct gfar_priv_grp - per group structure | ||
775 | * @priv: back pointer to the priv structure | ||
776 | * @regs: the ioremapped register space for this group | ||
777 | * @grp_id: group id for this group | ||
778 | * @interruptTransmit: The TX interrupt number for this group | ||
779 | * @interruptReceive: The RX interrupt number for this group | ||
780 | * @interruptError: The ERROR interrupt number for this group | ||
781 | * @int_name_tx: tx interrupt name for this group | ||
782 | * @int_name_rx: rx interrupt name for this group | ||
783 | * @int_name_er: er interrupt name for this group | ||
784 | */ | ||
785 | |||
786 | struct gfar_priv_grp { | ||
787 | spinlock_t grplock __attribute__ ((aligned (SMP_CACHE_BYTES))); | ||
788 | struct gfar_private *priv; | ||
789 | struct gfar __iomem *regs; | ||
790 | unsigned int interruptTransmit; | ||
791 | unsigned int interruptReceive; | ||
792 | unsigned int interruptError; | ||
793 | |||
794 | char int_name_tx[GFAR_INT_NAME_MAX]; | ||
795 | char int_name_rx[GFAR_INT_NAME_MAX]; | ||
796 | char int_name_er[GFAR_INT_NAME_MAX]; | ||
797 | }; | ||
798 | |||
773 | /* Struct stolen almost completely (and shamelessly) from the FCC enet source | 799 | /* Struct stolen almost completely (and shamelessly) from the FCC enet source |
774 | * (Ok, that's not so true anymore, but there is a family resemblence) | 800 | * (Ok, that's not so true anymore, but there is a family resemblence) |
775 | * The GFAR buffer descriptors track the ring buffers. The rx_bd_base | 801 | * The GFAR buffer descriptors track the ring buffers. The rx_bd_base |
@@ -785,6 +811,7 @@ struct gfar_private { | |||
785 | struct net_device *ndev; | 811 | struct net_device *ndev; |
786 | struct of_device *ofdev; | 812 | struct of_device *ofdev; |
787 | 813 | ||
814 | struct gfar_priv_grp gfargrp; | ||
788 | struct gfar_priv_tx_q *tx_queue; | 815 | struct gfar_priv_tx_q *tx_queue; |
789 | struct gfar_priv_rx_q *rx_queue; | 816 | struct gfar_priv_rx_q *rx_queue; |
790 | 817 | ||
@@ -797,9 +824,6 @@ struct gfar_private { | |||
797 | 824 | ||
798 | struct vlan_group *vlgrp; | 825 | struct vlan_group *vlgrp; |
799 | 826 | ||
800 | /* Unprotected fields */ | ||
801 | /* Pointer to the GFAR memory mapped Registers */ | ||
802 | struct gfar __iomem *regs; | ||
803 | 827 | ||
804 | /* Hash registers and their width */ | 828 | /* Hash registers and their width */ |
805 | u32 __iomem *hash_regs[16]; | 829 | u32 __iomem *hash_regs[16]; |
@@ -823,10 +847,6 @@ struct gfar_private { | |||
823 | wol_en:1; /* Wake-on-LAN enabled */ | 847 | wol_en:1; /* Wake-on-LAN enabled */ |
824 | unsigned short padding; | 848 | unsigned short padding; |
825 | 849 | ||
826 | unsigned int interruptTransmit; | ||
827 | unsigned int interruptReceive; | ||
828 | unsigned int interruptError; | ||
829 | |||
830 | /* PHY stuff */ | 850 | /* PHY stuff */ |
831 | struct phy_device *phydev; | 851 | struct phy_device *phydev; |
832 | struct mii_bus *mii_bus; | 852 | struct mii_bus *mii_bus; |
@@ -838,10 +858,6 @@ struct gfar_private { | |||
838 | 858 | ||
839 | struct work_struct reset_task; | 859 | struct work_struct reset_task; |
840 | 860 | ||
841 | char int_name_tx[GFAR_INT_NAME_MAX]; | ||
842 | char int_name_rx[GFAR_INT_NAME_MAX]; | ||
843 | char int_name_er[GFAR_INT_NAME_MAX]; | ||
844 | |||
845 | /* Network Statistics */ | 861 | /* Network Statistics */ |
846 | struct gfar_extra_stats extra_stats; | 862 | struct gfar_extra_stats extra_stats; |
847 | }; | 863 | }; |