1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * Marvell 88E6xxx Ethernet switch single-chip definition
5 * Copyright (c) 2008 Marvell Semiconductor
8 #ifndef _MV88E6XXX_CHIP_H
9 #define _MV88E6XXX_CHIP_H
11 #include <linux/idr.h>
12 #include <linux/if_vlan.h>
13 #include <linux/irq.h>
14 #include <linux/gpio/consumer.h>
15 #include <linux/kthread.h>
16 #include <linux/phy.h>
17 #include <linux/ptp_clock_kernel.h>
18 #include <linux/timecounter.h>
22 #define MV88E6XXX_N_FID 4096
24 /* PVT limits for 4-bit port and 5-bit switch */
25 #define MV88E6XXX_MAX_PVT_SWITCHES 32
26 #define MV88E6XXX_MAX_PVT_PORTS 16
27 #define MV88E6XXX_MAX_PVT_ENTRIES \
28 (MV88E6XXX_MAX_PVT_SWITCHES * MV88E6XXX_MAX_PVT_PORTS)
30 #define MV88E6XXX_MAX_GPIO 16
32 enum mv88e6xxx_egress_mode {
33 MV88E6XXX_EGRESS_MODE_UNMODIFIED,
34 MV88E6XXX_EGRESS_MODE_UNTAGGED,
35 MV88E6XXX_EGRESS_MODE_TAGGED,
36 MV88E6XXX_EGRESS_MODE_ETHERTYPE,
39 enum mv88e6xxx_egress_direction {
40 MV88E6XXX_EGRESS_DIR_INGRESS,
41 MV88E6XXX_EGRESS_DIR_EGRESS,
44 enum mv88e6xxx_frame_mode {
45 MV88E6XXX_FRAME_MODE_NORMAL,
46 MV88E6XXX_FRAME_MODE_DSA,
47 MV88E6XXX_FRAME_MODE_PROVIDER,
48 MV88E6XXX_FRAME_MODE_ETHERTYPE,
51 /* List of supported models */
52 enum mv88e6xxx_model {
86 enum mv88e6xxx_family {
87 MV88E6XXX_FAMILY_NONE,
88 MV88E6XXX_FAMILY_6065, /* 6031 6035 6061 6065 */
89 MV88E6XXX_FAMILY_6095, /* 6092 6095 */
90 MV88E6XXX_FAMILY_6097, /* 6046 6085 6096 6097 */
91 MV88E6XXX_FAMILY_6165, /* 6123 6161 6165 */
92 MV88E6XXX_FAMILY_6185, /* 6108 6121 6122 6131 6152 6155 6182 6185 */
93 MV88E6XXX_FAMILY_6250, /* 6220 6250 */
94 MV88E6XXX_FAMILY_6320, /* 6320 6321 */
95 MV88E6XXX_FAMILY_6341, /* 6141 6341 */
96 MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */
97 MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */
98 MV88E6XXX_FAMILY_6390, /* 6190 6190X 6191 6290 6390 6390X */
99 MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6393X */
103 * enum mv88e6xxx_edsa_support - Ethertype DSA tag support level
104 * @MV88E6XXX_EDSA_UNSUPPORTED: Device has no support for EDSA tags
105 * @MV88E6XXX_EDSA_UNDOCUMENTED: Documentation indicates that
106 * egressing FORWARD frames with an EDSA
107 * tag is reserved for future use, but
108 * empirical data shows that this mode
110 * @MV88E6XXX_EDSA_SUPPORTED: EDSA tags are fully supported.
112 enum mv88e6xxx_edsa_support {
113 MV88E6XXX_EDSA_UNSUPPORTED = 0,
114 MV88E6XXX_EDSA_UNDOCUMENTED,
115 MV88E6XXX_EDSA_SUPPORTED,
118 struct mv88e6xxx_ops;
120 struct mv88e6xxx_info {
121 enum mv88e6xxx_family family;
124 unsigned int num_databases;
125 unsigned int num_macs;
126 unsigned int num_ports;
127 unsigned int num_internal_phys;
128 unsigned int num_gpio;
129 unsigned int max_vid;
130 unsigned int port_base_addr;
131 unsigned int phy_base_addr;
132 unsigned int global1_addr;
133 unsigned int global2_addr;
134 unsigned int age_time_coeff;
135 unsigned int g1_irqs;
136 unsigned int g2_irqs;
139 /* Mark certain ports as invalid. This is required for example for the
140 * MV88E6220 (which is in general a MV88E6250 with 7 ports) but the
141 * ports 2-4 are not routet to pins.
143 unsigned int invalid_port_mask;
144 /* Multi-chip Addressing Mode.
145 * Some chips respond to only 2 registers of its own SMI device address
146 * when it is non-zero, and use indirect access to internal registers.
149 /* Dual-chip Addressing Mode
150 * Some chips respond to only half of the 32 SMI addresses,
151 * allowing two to coexist on the same SMI interface.
155 enum mv88e6xxx_edsa_support edsa_support;
157 /* Mask for FromPort and ToPort value of PortVec used in ATU Move
158 * operation. 0 means that the ATU Move operation is not supported.
160 u8 atu_move_port_mask;
161 const struct mv88e6xxx_ops *ops;
167 struct mv88e6xxx_atu_entry {
174 struct mv88e6xxx_vtu_entry {
179 u8 member[DSA_MAX_PORTS];
180 u8 state[DSA_MAX_PORTS];
183 struct mv88e6xxx_bus_ops;
184 struct mv88e6xxx_irq_ops;
185 struct mv88e6xxx_gpio_ops;
186 struct mv88e6xxx_avb_ops;
187 struct mv88e6xxx_ptp_ops;
189 struct mv88e6xxx_irq {
191 struct irq_chip chip;
192 struct irq_domain *domain;
196 /* state flags for mv88e6xxx_port_hwtstamp::state */
198 MV88E6XXX_HWTSTAMP_ENABLED,
199 MV88E6XXX_HWTSTAMP_TX_IN_PROGRESS,
202 struct mv88e6xxx_port_hwtstamp {
206 /* Timestamping state */
209 /* Resources for receive timestamping */
210 struct sk_buff_head rx_queue;
211 struct sk_buff_head rx_queue2;
213 /* Resources for transmit timestamping */
214 unsigned long tx_tstamp_start;
215 struct sk_buff *tx_skb;
218 /* Current timestamp configuration */
219 struct hwtstamp_config tstamp_config;
222 enum mv88e6xxx_policy_mapping {
223 MV88E6XXX_POLICY_MAPPING_DA,
224 MV88E6XXX_POLICY_MAPPING_SA,
225 MV88E6XXX_POLICY_MAPPING_VTU,
226 MV88E6XXX_POLICY_MAPPING_ETYPE,
227 MV88E6XXX_POLICY_MAPPING_PPPOE,
228 MV88E6XXX_POLICY_MAPPING_VBAS,
229 MV88E6XXX_POLICY_MAPPING_OPT82,
230 MV88E6XXX_POLICY_MAPPING_UDP,
233 enum mv88e6xxx_policy_action {
234 MV88E6XXX_POLICY_ACTION_NORMAL,
235 MV88E6XXX_POLICY_ACTION_MIRROR,
236 MV88E6XXX_POLICY_ACTION_TRAP,
237 MV88E6XXX_POLICY_ACTION_DISCARD,
240 struct mv88e6xxx_policy {
241 enum mv88e6xxx_policy_mapping mapping;
242 enum mv88e6xxx_policy_action action;
243 struct ethtool_rx_flow_spec fs;
249 struct mv88e6xxx_port {
250 struct mv88e6xxx_chip *chip;
253 u64 atu_member_violation;
254 u64 atu_miss_violation;
255 u64 atu_full_violation;
256 u64 vtu_member_violation;
257 u64 vtu_miss_violation;
258 phy_interface_t interface;
262 unsigned int serdes_irq;
263 char serdes_irq_name[64];
264 struct devlink_region *region;
267 enum mv88e6xxx_region_id {
268 MV88E6XXX_REGION_GLOBAL1 = 0,
269 MV88E6XXX_REGION_GLOBAL2,
270 MV88E6XXX_REGION_ATU,
271 MV88E6XXX_REGION_VTU,
272 MV88E6XXX_REGION_PVT,
274 _MV88E6XXX_REGION_MAX,
277 struct mv88e6xxx_region_priv {
278 enum mv88e6xxx_region_id id;
281 struct mv88e6xxx_chip {
282 const struct mv88e6xxx_info *info;
284 /* Currently configured tagging protocol */
285 enum dsa_tag_protocol tag_protocol;
287 /* The dsa_switch this private structure is related to */
288 struct dsa_switch *ds;
290 /* The device this structure is associated to */
293 /* This mutex protects the access to the switch registers */
294 struct mutex reg_lock;
296 /* The MII bus and the address on the bus that is used to
297 * communication with the switch
299 const struct mv88e6xxx_bus_ops *smi_ops;
303 /* Handles automatic disabling and re-enabling of the PHY
306 const struct mv88e6xxx_bus_ops *phy_ops;
307 struct mutex ppu_mutex;
309 struct work_struct ppu_work;
310 struct timer_list ppu_timer;
312 /* This mutex serialises access to the statistics unit.
313 * Hold this mutex over snapshot + dump sequences.
315 struct mutex stats_mutex;
317 /* A switch may have a GPIO line tied to its reset pin. Parse
318 * this from the device tree, and use it before performing
321 struct gpio_desc *reset;
323 /* set to size of eeprom if supported by the switch */
326 /* List of mdio busses */
327 struct list_head mdios;
329 /* Policy Control List IDs and rules */
332 /* There can be two interrupt controllers, which are chained
333 * off a GPIO as interrupt source
335 struct mv88e6xxx_irq g1_irq;
336 struct mv88e6xxx_irq g2_irq;
340 char device_irq_name[64];
342 char watchdog_irq_name[64];
345 char atu_prob_irq_name[64];
347 char vtu_prob_irq_name[64];
348 struct kthread_worker *kworker;
349 struct kthread_delayed_work irq_poll_work;
354 /* This cyclecounter abstracts the switch PTP time.
355 * reg_lock must be held for any operation that read()s.
357 struct cyclecounter tstamp_cc;
358 struct timecounter tstamp_tc;
359 struct delayed_work overflow_work;
361 struct ptp_clock *ptp_clock;
362 struct ptp_clock_info ptp_clock_info;
363 struct delayed_work tai_event_work;
364 struct ptp_pin_desc pin_config[MV88E6XXX_MAX_GPIO];
369 /* Current ingress and egress monitor ports */
370 int egress_dest_port;
371 int ingress_dest_port;
373 /* Per-port timestamping resources. */
374 struct mv88e6xxx_port_hwtstamp port_hwtstamp[DSA_MAX_PORTS];
376 /* Array of port structures. */
377 struct mv88e6xxx_port ports[DSA_MAX_PORTS];
379 /* devlink regions */
380 struct devlink_region *regions[_MV88E6XXX_REGION_MAX];
383 struct mv88e6xxx_bus_ops {
384 int (*read)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
385 int (*write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
388 struct mv88e6xxx_mdio_bus {
390 struct mv88e6xxx_chip *chip;
391 struct list_head list;
395 struct mv88e6xxx_ops {
396 /* Switch Setup Errata, called early in the switch setup to
397 * allow any errata actions to be performed
399 int (*setup_errata)(struct mv88e6xxx_chip *chip);
401 int (*ieee_pri_map)(struct mv88e6xxx_chip *chip);
402 int (*ip_pri_map)(struct mv88e6xxx_chip *chip);
404 /* Ingress Rate Limit unit (IRL) operations */
405 int (*irl_init_all)(struct mv88e6xxx_chip *chip, int port);
407 int (*get_eeprom)(struct mv88e6xxx_chip *chip,
408 struct ethtool_eeprom *eeprom, u8 *data);
409 int (*set_eeprom)(struct mv88e6xxx_chip *chip,
410 struct ethtool_eeprom *eeprom, u8 *data);
412 int (*set_switch_mac)(struct mv88e6xxx_chip *chip, u8 *addr);
414 int (*phy_read)(struct mv88e6xxx_chip *chip,
416 int addr, int reg, u16 *val);
417 int (*phy_write)(struct mv88e6xxx_chip *chip,
419 int addr, int reg, u16 val);
421 /* Priority Override Table operations */
422 int (*pot_clear)(struct mv88e6xxx_chip *chip);
424 /* PHY Polling Unit (PPU) operations */
425 int (*ppu_enable)(struct mv88e6xxx_chip *chip);
426 int (*ppu_disable)(struct mv88e6xxx_chip *chip);
428 /* Switch Software Reset */
429 int (*reset)(struct mv88e6xxx_chip *chip);
431 /* RGMII Receive/Transmit Timing Control
432 * Add delay on PHY_INTERFACE_MODE_RGMII_*ID, no delay otherwise.
434 int (*port_set_rgmii_delay)(struct mv88e6xxx_chip *chip, int port,
435 phy_interface_t mode);
437 #define LINK_FORCED_DOWN 0
438 #define LINK_FORCED_UP 1
439 #define LINK_UNFORCED -2
441 /* Port's MAC link state
442 * Use LINK_FORCED_UP or LINK_FORCED_DOWN to force link up or down,
443 * or LINK_UNFORCED for normal link detection.
445 int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int link);
447 /* Synchronise the port link state with that of the SERDES
449 int (*port_sync_link)(struct mv88e6xxx_chip *chip, int port, unsigned int mode, bool isup);
454 /* Enable/disable sending Pause */
455 int (*port_set_pause)(struct mv88e6xxx_chip *chip, int port,
458 #define SPEED_MAX INT_MAX
459 #define SPEED_UNFORCED -2
460 #define DUPLEX_UNFORCED -2
462 /* Port's MAC speed (in Mbps) and MAC duplex mode
464 * Depending on the chip, 10, 100, 200, 1000, 2500, 10000 are valid.
465 * Use SPEED_UNFORCED for normal detection, SPEED_MAX for max value.
467 * Use DUPLEX_HALF or DUPLEX_FULL to force half or full duplex,
468 * or DUPLEX_UNFORCED for normal duplex detection.
470 int (*port_set_speed_duplex)(struct mv88e6xxx_chip *chip, int port,
471 int speed, int duplex);
473 /* What interface mode should be used for maximum speed? */
474 phy_interface_t (*port_max_speed_mode)(int port);
476 int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port);
478 int (*port_set_policy)(struct mv88e6xxx_chip *chip, int port,
479 enum mv88e6xxx_policy_mapping mapping,
480 enum mv88e6xxx_policy_action action);
482 int (*port_set_frame_mode)(struct mv88e6xxx_chip *chip, int port,
483 enum mv88e6xxx_frame_mode mode);
484 int (*port_set_ucast_flood)(struct mv88e6xxx_chip *chip, int port,
486 int (*port_set_mcast_flood)(struct mv88e6xxx_chip *chip, int port,
488 int (*port_set_ether_type)(struct mv88e6xxx_chip *chip, int port,
490 int (*port_set_jumbo_size)(struct mv88e6xxx_chip *chip, int port,
493 int (*port_egress_rate_limiting)(struct mv88e6xxx_chip *chip, int port);
494 int (*port_pause_limit)(struct mv88e6xxx_chip *chip, int port, u8 in,
496 int (*port_disable_learn_limit)(struct mv88e6xxx_chip *chip, int port);
497 int (*port_disable_pri_override)(struct mv88e6xxx_chip *chip, int port);
498 int (*port_setup_message_port)(struct mv88e6xxx_chip *chip, int port);
500 /* CMODE control what PHY mode the MAC will use, eg. SGMII, RGMII, etc.
501 * Some chips allow this to be configured on specific ports.
503 int (*port_set_cmode)(struct mv88e6xxx_chip *chip, int port,
504 phy_interface_t mode);
505 int (*port_get_cmode)(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
507 /* Some devices have a per port register indicating what is
508 * the upstream port this port should forward to.
510 int (*port_set_upstream_port)(struct mv88e6xxx_chip *chip, int port,
513 /* Snapshot the statistics for a port. The statistics can then
514 * be read back a leisure but still with a consistent view.
516 int (*stats_snapshot)(struct mv88e6xxx_chip *chip, int port);
518 /* Set the histogram mode for statistics, when the control registers
519 * are separated out of the STATS_OP register.
521 int (*stats_set_histogram)(struct mv88e6xxx_chip *chip);
523 /* Return the number of strings describing statistics */
524 int (*stats_get_sset_count)(struct mv88e6xxx_chip *chip);
525 int (*stats_get_strings)(struct mv88e6xxx_chip *chip, uint8_t *data);
526 int (*stats_get_stats)(struct mv88e6xxx_chip *chip, int port,
528 int (*set_cpu_port)(struct mv88e6xxx_chip *chip, int port);
529 int (*set_egress_port)(struct mv88e6xxx_chip *chip,
530 enum mv88e6xxx_egress_direction direction,
533 #define MV88E6XXX_CASCADE_PORT_NONE 0xe
534 #define MV88E6XXX_CASCADE_PORT_MULTIPLE 0xf
536 int (*set_cascade_port)(struct mv88e6xxx_chip *chip, int port);
538 const struct mv88e6xxx_irq_ops *watchdog_ops;
540 int (*mgmt_rsvd2cpu)(struct mv88e6xxx_chip *chip);
542 /* Power on/off a SERDES interface */
543 int (*serdes_power)(struct mv88e6xxx_chip *chip, int port, int lane,
546 /* SERDES lane mapping */
547 int (*serdes_get_lane)(struct mv88e6xxx_chip *chip, int port);
549 int (*serdes_pcs_get_state)(struct mv88e6xxx_chip *chip, int port,
550 int lane, struct phylink_link_state *state);
551 int (*serdes_pcs_config)(struct mv88e6xxx_chip *chip, int port,
552 int lane, unsigned int mode,
553 phy_interface_t interface,
554 const unsigned long *advertise);
555 int (*serdes_pcs_an_restart)(struct mv88e6xxx_chip *chip, int port,
557 int (*serdes_pcs_link_up)(struct mv88e6xxx_chip *chip, int port,
558 int lane, int speed, int duplex);
560 /* SERDES interrupt handling */
561 unsigned int (*serdes_irq_mapping)(struct mv88e6xxx_chip *chip,
563 int (*serdes_irq_enable)(struct mv88e6xxx_chip *chip, int port, int lane,
565 irqreturn_t (*serdes_irq_status)(struct mv88e6xxx_chip *chip, int port,
568 /* Statistics from the SERDES interface */
569 int (*serdes_get_sset_count)(struct mv88e6xxx_chip *chip, int port);
570 int (*serdes_get_strings)(struct mv88e6xxx_chip *chip, int port,
572 int (*serdes_get_stats)(struct mv88e6xxx_chip *chip, int port,
575 /* SERDES registers for ethtool */
576 int (*serdes_get_regs_len)(struct mv88e6xxx_chip *chip, int port);
577 void (*serdes_get_regs)(struct mv88e6xxx_chip *chip, int port,
580 /* Address Translation Unit operations */
581 int (*atu_get_hash)(struct mv88e6xxx_chip *chip, u8 *hash);
582 int (*atu_set_hash)(struct mv88e6xxx_chip *chip, u8 hash);
584 /* VLAN Translation Unit operations */
585 int (*vtu_getnext)(struct mv88e6xxx_chip *chip,
586 struct mv88e6xxx_vtu_entry *entry);
587 int (*vtu_loadpurge)(struct mv88e6xxx_chip *chip,
588 struct mv88e6xxx_vtu_entry *entry);
590 /* GPIO operations */
591 const struct mv88e6xxx_gpio_ops *gpio_ops;
593 /* Interface to the AVB/PTP registers */
594 const struct mv88e6xxx_avb_ops *avb_ops;
596 /* Remote Management Unit operations */
597 int (*rmu_disable)(struct mv88e6xxx_chip *chip);
599 /* Precision Time Protocol operations */
600 const struct mv88e6xxx_ptp_ops *ptp_ops;
603 void (*phylink_validate)(struct mv88e6xxx_chip *chip, int port,
605 struct phylink_link_state *state);
608 int (*set_max_frame_size)(struct mv88e6xxx_chip *chip, int mtu);
611 struct mv88e6xxx_irq_ops {
612 /* Action to be performed when the interrupt happens */
613 int (*irq_action)(struct mv88e6xxx_chip *chip, int irq);
614 /* Setup the hardware to generate the interrupt */
615 int (*irq_setup)(struct mv88e6xxx_chip *chip);
616 /* Reset the hardware to stop generating the interrupt */
617 void (*irq_free)(struct mv88e6xxx_chip *chip);
620 struct mv88e6xxx_gpio_ops {
621 /* Get/set data on GPIO pin */
622 int (*get_data)(struct mv88e6xxx_chip *chip, unsigned int pin);
623 int (*set_data)(struct mv88e6xxx_chip *chip, unsigned int pin,
626 /* get/set GPIO direction */
627 int (*get_dir)(struct mv88e6xxx_chip *chip, unsigned int pin);
628 int (*set_dir)(struct mv88e6xxx_chip *chip, unsigned int pin,
631 /* get/set GPIO pin control */
632 int (*get_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
634 int (*set_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
638 struct mv88e6xxx_avb_ops {
639 /* Access port-scoped Precision Time Protocol registers */
640 int (*port_ptp_read)(struct mv88e6xxx_chip *chip, int port, int addr,
642 int (*port_ptp_write)(struct mv88e6xxx_chip *chip, int port, int addr,
645 /* Access global Precision Time Protocol registers */
646 int (*ptp_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
648 int (*ptp_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
650 /* Access global Time Application Interface registers */
651 int (*tai_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
653 int (*tai_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
656 struct mv88e6xxx_ptp_ops {
657 u64 (*clock_read)(const struct cyclecounter *cc);
658 int (*ptp_enable)(struct ptp_clock_info *ptp,
659 struct ptp_clock_request *rq, int on);
660 int (*ptp_verify)(struct ptp_clock_info *ptp, unsigned int pin,
661 enum ptp_pin_function func, unsigned int chan);
662 void (*event_work)(struct work_struct *ugly);
663 int (*port_enable)(struct mv88e6xxx_chip *chip, int port);
664 int (*port_disable)(struct mv88e6xxx_chip *chip, int port);
665 int (*global_enable)(struct mv88e6xxx_chip *chip);
666 int (*global_disable)(struct mv88e6xxx_chip *chip);
678 #define STATS_TYPE_PORT BIT(0)
679 #define STATS_TYPE_BANK0 BIT(1)
680 #define STATS_TYPE_BANK1 BIT(2)
682 struct mv88e6xxx_hw_stat {
683 char string[ETH_GSTRING_LEN];
689 static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)
691 return chip->info->pvt;
694 static inline bool mv88e6xxx_has_lag(struct mv88e6xxx_chip *chip)
696 return !!chip->info->global2_addr;
699 static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
701 return chip->info->num_databases;
704 static inline unsigned int mv88e6xxx_num_macs(struct mv88e6xxx_chip *chip)
706 return chip->info->num_macs;
709 static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
711 return chip->info->num_ports;
714 static inline unsigned int mv88e6xxx_max_vid(struct mv88e6xxx_chip *chip)
716 return chip->info->max_vid;
719 static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip)
721 return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0);
724 static inline unsigned int mv88e6xxx_num_gpio(struct mv88e6xxx_chip *chip)
726 return chip->info->num_gpio;
729 static inline bool mv88e6xxx_is_invalid_port(struct mv88e6xxx_chip *chip, int port)
731 return (chip->info->invalid_port_mask & BIT(port)) != 0;
734 int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
735 int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
736 int mv88e6xxx_wait_mask(struct mv88e6xxx_chip *chip, int addr, int reg,
738 int mv88e6xxx_wait_bit(struct mv88e6xxx_chip *chip, int addr, int reg,
740 struct mii_bus *mv88e6xxx_default_mdio_bus(struct mv88e6xxx_chip *chip);
742 static inline void mv88e6xxx_reg_lock(struct mv88e6xxx_chip *chip)
744 mutex_lock(&chip->reg_lock);
747 static inline void mv88e6xxx_reg_unlock(struct mv88e6xxx_chip *chip)
749 mutex_unlock(&chip->reg_lock);
752 int mv88e6xxx_fid_map(struct mv88e6xxx_chip *chip, unsigned long *bitmap);
754 #endif /* _MV88E6XXX_CHIP_H */