Message ID | 1262855243-6762-3-git-send-email-peppe.cavallaro@st.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
Giuseppe CAVALLARO wrote: > Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> > --- > include/linux/stmmac.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 53 insertions(+), 0 deletions(-) > create mode 100644 include/linux/stmmac.h > > diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h > new file mode 100644 > index 0000000..32bfd1a > --- /dev/null > +++ b/include/linux/stmmac.h > Coming to think of it, it might be preferable to locate this file in drivers/net/stmmac/stmmac_plat.h and have the platform-specific code do inclusions like: #include "../../../drivers/net/stmmac/stmmac_plat.h" jh -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jean-Hugues, Jean-Hugues Deschenes wrote: > > Giuseppe CAVALLARO wrote: >> Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> >> --- >> include/linux/stmmac.h | 53 >> ++++++++++++++++++++++++++++++++++++++++++++++++ >> 1 files changed, 53 insertions(+), 0 deletions(-) >> create mode 100644 include/linux/stmmac.h >> >> diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h >> new file mode 100644 >> index 0000000..32bfd1a >> --- /dev/null >> +++ b/include/linux/stmmac.h >> > Coming to think of it, it might be preferable to locate this file in > drivers/net/stmmac/stmmac_plat.h and have the platform-specific code do > inclusions like: #include "../../../drivers/net/stmmac/stmmac_plat.h" Indeed, I don't like the include/linux/stmmac.h file but it's not only, see the dm9000.h file. Moreover, moving this header file within drivers/net/stmmac directory, each board setup file (arch/sh/boards/mach-<name>/setup.c should have #include "../../../../drivers/net/stmmac/stmmac_plat.h". Is it a good solution? So i can think the include/linux/stmmac.h remains the way (like for the architectures that use the Davicom DM9000 adapter). At any rate, welcome advice as usual. Regards, Peppe > > jh > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktF4dcACgkQ2Xo3j31MSSKTFwCfXwrMhGK/3zin53G+oqMGgZgf Y2AAmwWNvVARWEgM8VdNSyp5xY7ntlk6 =XwJD -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Giuseppe CAVALLARO wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Hi Jean-Hugues, > > Jean-Hugues Deschenes wrote: > >> Coming to think of it, it might be preferable to locate this file in >> drivers/net/stmmac/stmmac_plat.h and have the platform-specific code do >> inclusions like: #include "../../../drivers/net/stmmac/stmmac_plat.h" >> > > Indeed, I don't like the include/linux/stmmac.h file but it's not only, > see the dm9000.h file. > > Moreover, moving this header file within drivers/net/stmmac directory, > each board setup file (arch/sh/boards/mach-<name>/setup.c should have > #include "../../../../drivers/net/stmmac/stmmac_plat.h". Is it a good > solution? I took a look at the the arch subdirectory before suggesting this: grep -RI "^\#include.*\/drivers" * m32r/platforms/usrv/io.c:#include "../../../../drivers/pcmcia/m32r_cfc.h" s390/mm/cmm.c:#include "../../../drivers/s390/net/smsgiucv.h" x86/kernel/asm-offsets_32.c:#include "../../../drivers/lguest/lg.h" ... so we wouldn't be the only ones... but then again, as with your Davicom dm9000.h example, we wouldn't be the only ones to locate it in include/linux either... so...? jh -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Jean-Hugues, Jean-Hugues Deschenes wrote: > I took a look at the the arch subdirectory before suggesting this: > grep -RI "^\#include.*\/drivers" * > m32r/platforms/usrv/io.c:#include "../../../../drivers/pcmcia/m32r_cfc.h" > s390/mm/cmm.c:#include "../../../drivers/s390/net/smsgiucv.h" > x86/kernel/asm-offsets_32.c:#include "../../../drivers/lguest/lg.h" > > ... so we wouldn't be the only ones... but then again, as with your > Davicom dm9000.h example, we wouldn't be the only ones to locate it in > include/linux either... so...? Yes you are right :-) ! Another question. Indeed, for stm architectures, within each setup file, we don't include the linux/stmmac.h (I was wrong before!) but include linux/stm/platform.h. This own header includes the "linux/stmmac.h". So using stmmac_plat.h, I should add: #include "../../../drivers/net/stmmac/stmmac_plat.h" within the include/linux/stm/platform.h file. Is it ok? What do you think? Thanks Peppe > > jh > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktF6UEACgkQ2Xo3j31MSSJ+WQCgpTM9z6/b7JaXq60TaQTN39P0 Tv0An3PFCB4nPUmxTUphrupPTp65mW2d =kzPv -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Giuseppe, Giuseppe CAVALLARO wrote: > Another question. Indeed, for stm architectures, within each setup file, > we don't include the linux/stmmac.h (I was wrong before!) but include > linux/stm/platform.h. This own header includes the "linux/stmmac.h". > So using stmmac_plat.h, I should add: #include > "../../../drivers/net/stmmac/stmmac_plat.h" within the > include/linux/stm/platform.h file. Is it ok? What do you think? > > I believe that would work out well. ... Although I wonder if the whole stm subdirectory should be in include/linux, rather than in arch/sh... But that's another story... It is there because you maintain both sh and arm-base SOCs right? thanks, jh -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jean-Hugues Deschenes wrote: > Hi Giuseppe, > > Giuseppe CAVALLARO wrote: >> Another question. Indeed, for stm architectures, within each setup file, >> we don't include the linux/stmmac.h (I was wrong before!) but include >> linux/stm/platform.h. This own header includes the "linux/stmmac.h". >> So using stmmac_plat.h, I should add: #include >> "../../../drivers/net/stmmac/stmmac_plat.h" within the >> include/linux/stm/platform.h file. Is it ok? What do you think? >> > I believe that would work out well. > > ... Although I wonder if the whole stm subdirectory should be in > include/linux, rather than in arch/sh... Sorry, I was not not clear before. the stm subdirectory is in include/linux. In fact, my previous question was if it's good to include ./../../drivers/net/stmmac/stmmac_plat.h within the include/linux/stm/platform.h file. But that's another story... It > is there because you maintain both sh and arm-base SOCs right? Yes you are right! Peppe > > thanks, > jh > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktF7bgACgkQ2Xo3j31MSSIKAgCgsEnwCKaYFsbpiEz4KAB370tJ UxAAoLucaQqakElDfQHRYbn11zMhwIFB =56bk -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Giuseppe CAVALLARO wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Jean-Hugues Deschenes wrote: > >> Hi Giuseppe, >> >> Giuseppe CAVALLARO wrote: >> >>> Another question. Indeed, for stm architectures, within each setup file, >>> we don't include the linux/stmmac.h (I was wrong before!) but include >>> linux/stm/platform.h. This own header includes the "linux/stmmac.h". >>> So using stmmac_plat.h, I should add: #include >>> "../../../drivers/net/stmmac/stmmac_plat.h" within the >>> include/linux/stm/platform.h file. Is it ok? What do you think? >>> >>> >> I believe that would work out well. >> >> ... Although I wonder if the whole stm subdirectory should be in >> include/linux, rather than in arch/sh... >> > Sorry, I was not not clear before. the stm subdirectory is in > include/linux. > You were quite clear; sorry, my mistake; I should have written "... Although I wonder if the whole stm subdirectory should be in arch/sh, rather than in include/linux..." > In fact, my previous question was if it's good to include > ../../../drivers/net/stmmac/stmmac_plat.h within the > include/linux/stm/platform.h file. > I don't see a problem with that, although we'd be the first doing it... probably as long as the include ../../../drivers/net/stmmac/stmmac_plat.h is surrounded by the appropriate #ifdef CONFIG_STMMAC_ETH? > But that's another story... It > >> is there because you maintain both sh and arm-base SOCs right? >> > Yes you are right! > ... so ideally, you'need some kind of arch/common, arch/shared or include/linux/platform directory of some kind... Too bad such a thing doesn't exist... Regards, jh -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Jean-Hugues Deschenes wrote: > Giuseppe CAVALLARO wrote: >> In fact, my previous question was if it's good to include >> ../../../drivers/net/stmmac/stmmac_plat.h within the >> include/linux/stm/platform.h file. >> > I don't see a problem with that, although we'd be the first doing it... > probably as long as the include > ../../../drivers/net/stmmac/stmmac_plat.h is surrounded by the > appropriate #ifdef CONFIG_STMMAC_ETH? Hi Jean-Hugues, I can rework this moving the stmmac platform header from include/linux/stmmac.h to drivers/net/stmmac/stmmac_plat.h On stlinux kernel the include/linux/stm/platform.h header will include ../../../drivers/net/stmmac/stmmac_plat.h instead of linux/stmmac.h. Any other comments? To David: I've also removed __FILE__ as you had already suggested. Many Thanks. Regards, Peppe >> But that's another story... It >> >>> is there because you maintain both sh and arm-base SOCs right? >>> >> Yes you are right! >> > ... so ideally, you'need some kind of arch/common, arch/shared or > include/linux/platform directory of some kind... Too bad such a thing > doesn't exist... > Regards, > jh > -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAktF96UACgkQ2Xo3j31MSSLG2wCgsc0SNGLgkXrlzvLq+moQst2D QvgAnAxTAB5np8Xc3d6rF1+9nftk6nxP =GL1t -----END PGP SIGNATURE----- -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Giuseppe CAVALLARO wrote: > I can rework this moving the stmmac platform header from > include/linux/stmmac.h > to > drivers/net/stmmac/stmmac_plat.h > > On stlinux kernel the include/linux/stm/platform.h header will include > .../../../drivers/net/stmmac/stmmac_plat.h instead of linux/stmmac.h. > > Any other comments? > Nope; I'll let you know if I notice something else. Thanks! jh -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
From: Jean-Hugues Deschenes <jean-hugues.deschenes@octasic.com> Date: Thu, 07 Jan 2010 10:06:50 -0500 > > > Giuseppe CAVALLARO wrote: >> I can rework this moving the stmmac platform header from >> include/linux/stmmac.h >> to >> drivers/net/stmmac/stmmac_plat.h >> >> On stlinux kernel the include/linux/stm/platform.h header will include >> .../../../drivers/net/stmmac/stmmac_plat.h instead of linux/stmmac.h. >> >> Any other comments? >> > Nope; I'll let you know if I notice something else. I've applied this version of the stmmac patches to net-next-2.6. On the topic of platform data, it should live in a include/linux/foo.h file, anything else is incredibly messy at the moment. Send any further changes relative to this patch set. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h new file mode 100644 index 0000000..32bfd1a --- /dev/null +++ b/include/linux/stmmac.h @@ -0,0 +1,53 @@ +/******************************************************************************* + + Header file for stmmac platform data + + Copyright (C) 2009 STMicroelectronics Ltd + + This program is free software; you can redistribute it and/or modify it + under the terms and conditions of the GNU General Public License, + version 2, as published by the Free Software Foundation. + + This program is distributed in the hope it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. + + The full GNU General Public License is included in this distribution in + the file called "COPYING". + + Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> +*******************************************************************************/ + +#ifndef __STMMAC_PLATFORM_DATA +#define __STMMAC_PLATFORM_DATA + +/* platfrom data for platfrom device structure's platfrom_data field */ + +/* Private data for the STM on-board ethernet driver */ +struct plat_stmmacenet_data { + int bus_id; + int pbl; + int has_gmac; + void (*fix_mac_speed)(void *priv, unsigned int speed); + void (*bus_setup)(unsigned long ioaddr); +#ifdef CONFIG_STM_DRIVERS + struct stm_pad_config *pad_config; +#endif + void *bsp_priv; +}; + +struct plat_stmmacphy_data { + int bus_id; + int phy_addr; + unsigned int phy_mask; + int interface; + int (*phy_reset)(void *priv); + void *priv; +}; +#endif +
Signed-off-by: Giuseppe Cavallaro <peppe.cavallaro@st.com> --- include/linux/stmmac.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 53 insertions(+), 0 deletions(-) create mode 100644 include/linux/stmmac.h