Commit graph

11 commits

Author SHA1 Message Date
Gabor Juhos
065bc60f37 ip17xx: Introduce indirection of low-level operations
This patch introduces seperation between low-level and high-level parts
of the driver. The low-level functions are now called via pointers stored
in struct ip175c_regs.

The only functional changes are:

  o  correct_vlan_state() is now called as a part of every update_state().

  o  The order of setting of MODE_REG and resetting switch ports
     has changed. (These are independent actions, so it should not matter.)

  o  ip175c_set_tagged() sets the tags via update_state() instead of writing
     directly to the registers.

  o  The same for ip175c_set_pvid().

The only gaps in this abstraction are operations on ports (get_port_speed
and friends), which access PHY registers directly.

Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21714
2010-06-08 20:18:20 +00:00
Gabor Juhos
09be47cf90 ip17xx: Fix use of MODE_VAL
The value written to MODE_REG in ip175c_reset() should be obviously MODE_VAL,
not RESET_VAL. Actually, this change is a NOP, because in the only case where
the MODE_REG is used, the two values are identical, but it makes the code
more readable.

Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21713
2010-06-08 20:18:15 +00:00
Gabor Juhos
f09e3fb65b ip17xx: Fix indentation in get_state() and update_state()
Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21712
2010-06-08 20:18:10 +00:00
Gabor Juhos
7b5a77fa39 ip17xx: Fixed error handling in ip175c_set_val()
Upon error, ip175c_set_val() returned 0 instead of -EINVAL.

Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21711
2010-06-08 20:18:05 +00:00
Gabor Juhos
b3073617a5 ip17xx: Cosmetic cleanups
Trying to unify capitalization and formatting of comments. Writing of periods
at the end of comments is however still inconsistent.

Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21710
2010-06-08 20:18:00 +00:00
Gabor Juhos
f96f1cd16f ip17xx: Consolidate operations with PHY registers
Call mdiobus_{read,write} instead of duplicating their code.

Introduce ip_phy_write_masked(), which changes a part of a register. Will
be used later in this patch series. Please note that it does not hold any
lock between reading and writing, so it is up to the caller to serialize.

Also add DUMP_MII_IO, which enables logging of all MII accesses.

Signed-off-by: Martin Mares <mj@ucw.cz>
Signed-off-by: Patrick Horn <patrick.horn@gmail.com>

SVN-Revision: 21709
2010-06-08 20:17:55 +00:00
Felix Fietkau
e4a6acf9b8 enable IP175A support in the IP175C PHY driver (based on patch from jh in #6733)
SVN-Revision: 20551
2010-03-28 18:57:42 +00:00
Felix Fietkau
4e12c9d210 fix a crash in ip175c attribute enumeration
SVN-Revision: 15506
2009-04-30 13:57:22 +00:00
Felix Fietkau
8ec2ad91ad swconfig: add a generic switch reset call
SVN-Revision: 15470
2009-04-28 19:16:17 +00:00
Felix Fietkau
3fce73ce46 clean up the ip175c driver some more, add support for setting the pvid and fix querying the phy status
SVN-Revision: 15308
2009-04-20 21:26:44 +00:00
Felix Fietkau
4320a28228 add IC+ IP175C driver (based on Patrick Horn's driver, see #4050)
SVN-Revision: 15305
2009-04-20 18:57:55 +00:00