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>
21 #define MV88E6XXX_N_FID 4096
23 /* PVT limits for 4-bit port and 5-bit switch */
24 #define MV88E6XXX_MAX_PVT_SWITCHES 32
25 #define MV88E6XXX_MAX_PVT_PORTS 16
26 #define MV88E6XXX_MAX_PVT_ENTRIES \
27 (MV88E6XXX_MAX_PVT_SWITCHES * MV88E6XXX_MAX_PVT_PORTS)
29 #define MV88E6XXX_MAX_GPIO 16
31 enum mv88e6xxx_egress_mode {
32 MV88E6XXX_EGRESS_MODE_UNMODIFIED,
33 MV88E6XXX_EGRESS_MODE_UNTAGGED,
34 MV88E6XXX_EGRESS_MODE_TAGGED,
35 MV88E6XXX_EGRESS_MODE_ETHERTYPE,
38 enum mv88e6xxx_egress_direction {
39 MV88E6XXX_EGRESS_DIR_INGRESS,
40 MV88E6XXX_EGRESS_DIR_EGRESS,
43 enum mv88e6xxx_frame_mode {
44 MV88E6XXX_FRAME_MODE_NORMAL,
45 MV88E6XXX_FRAME_MODE_DSA,
46 MV88E6XXX_FRAME_MODE_PROVIDER,
47 MV88E6XXX_FRAME_MODE_ETHERTYPE,
50 /* List of supported models */
51 enum mv88e6xxx_model {
85 enum mv88e6xxx_family {
86 MV88E6XXX_FAMILY_NONE,
87 MV88E6XXX_FAMILY_6065, /* 6031 6035 6061 6065 */
88 MV88E6XXX_FAMILY_6095, /* 6092 6095 */
89 MV88E6XXX_FAMILY_6097, /* 6046 6085 6096 6097 */
90 MV88E6XXX_FAMILY_6165, /* 6123 6161 6165 */
91 MV88E6XXX_FAMILY_6185, /* 6108 6121 6122 6131 6152 6155 6182 6185 */
92 MV88E6XXX_FAMILY_6250, /* 6220 6250 */
93 MV88E6XXX_FAMILY_6320, /* 6320 6321 */
94 MV88E6XXX_FAMILY_6341, /* 6141 6341 */
95 MV88E6XXX_FAMILY_6351, /* 6171 6175 6350 6351 */
96 MV88E6XXX_FAMILY_6352, /* 6172 6176 6240 6352 */
97 MV88E6XXX_FAMILY_6390, /* 6190 6190X 6191 6290 6390 6390X */
98 MV88E6XXX_FAMILY_6393, /* 6191X 6193X 6393X */
102 * enum mv88e6xxx_edsa_support - Ethertype DSA tag support level
103 * @MV88E6XXX_EDSA_UNSUPPORTED: Device has no support for EDSA tags
104 * @MV88E6XXX_EDSA_UNDOCUMENTED: Documentation indicates that
105 * egressing FORWARD frames with an EDSA
106 * tag is reserved for future use, but
107 * empirical data shows that this mode
109 * @MV88E6XXX_EDSA_SUPPORTED: EDSA tags are fully supported.
111 enum mv88e6xxx_edsa_support {
112 MV88E6XXX_EDSA_UNSUPPORTED = 0,
113 MV88E6XXX_EDSA_UNDOCUMENTED,
114 MV88E6XXX_EDSA_SUPPORTED,
117 struct mv88e6xxx_ops;
119 struct mv88e6xxx_info {
120 enum mv88e6xxx_family family;
123 unsigned int num_databases;
124 unsigned int num_macs;
125 unsigned int num_ports;
126 unsigned int num_internal_phys;
127 unsigned int num_gpio;
128 unsigned int max_vid;
129 unsigned int port_base_addr;
130 unsigned int phy_base_addr;
131 unsigned int global1_addr;
132 unsigned int global2_addr;
133 unsigned int age_time_coeff;
134 unsigned int g1_irqs;
135 unsigned int g2_irqs;
138 /* Mark certain ports as invalid. This is required for example for the
139 * MV88E6220 (which is in general a MV88E6250 with 7 ports) but the
140 * ports 2-4 are not routet to pins.
142 unsigned int invalid_port_mask;
143 /* Multi-chip Addressing Mode.
144 * Some chips respond to only 2 registers of its own SMI device address
145 * when it is non-zero, and use indirect access to internal registers.
148 /* Dual-chip Addressing Mode
149 * Some chips respond to only half of the 32 SMI addresses,
150 * allowing two to coexist on the same SMI interface.
154 enum mv88e6xxx_edsa_support edsa_support;
156 /* Mask for FromPort and ToPort value of PortVec used in ATU Move
157 * operation. 0 means that the ATU Move operation is not supported.
159 u8 atu_move_port_mask;
160 const struct mv88e6xxx_ops *ops;
166 struct mv88e6xxx_atu_entry {
173 struct mv88e6xxx_vtu_entry {
178 u8 member[DSA_MAX_PORTS];
179 u8 state[DSA_MAX_PORTS];
182 struct mv88e6xxx_bus_ops;
183 struct mv88e6xxx_irq_ops;
184 struct mv88e6xxx_gpio_ops;
185 struct mv88e6xxx_avb_ops;
186 struct mv88e6xxx_ptp_ops;
188 struct mv88e6xxx_irq {
190 struct irq_chip chip;
191 struct irq_domain *domain;
195 /* state flags for mv88e6xxx_port_hwtstamp::state */
197 MV88E6XXX_HWTSTAMP_ENABLED,
198 MV88E6XXX_HWTSTAMP_TX_IN_PROGRESS,
201 struct mv88e6xxx_port_hwtstamp {
205 /* Timestamping state */
208 /* Resources for receive timestamping */
209 struct sk_buff_head rx_queue;
210 struct sk_buff_head rx_queue2;
212 /* Resources for transmit timestamping */
213 unsigned long tx_tstamp_start;
214 struct sk_buff *tx_skb;
217 /* Current timestamp configuration */
218 struct hwtstamp_config tstamp_config;
221 enum mv88e6xxx_policy_mapping {
222 MV88E6XXX_POLICY_MAPPING_DA,
223 MV88E6XXX_POLICY_MAPPING_SA,
224 MV88E6XXX_POLICY_MAPPING_VTU,
225 MV88E6XXX_POLICY_MAPPING_ETYPE,
226 MV88E6XXX_POLICY_MAPPING_PPPOE,
227 MV88E6XXX_POLICY_MAPPING_VBAS,
228 MV88E6XXX_POLICY_MAPPING_OPT82,
229 MV88E6XXX_POLICY_MAPPING_UDP,
232 enum mv88e6xxx_policy_action {
233 MV88E6XXX_POLICY_ACTION_NORMAL,
234 MV88E6XXX_POLICY_ACTION_MIRROR,
235 MV88E6XXX_POLICY_ACTION_TRAP,
236 MV88E6XXX_POLICY_ACTION_DISCARD,
239 struct mv88e6xxx_policy {
240 enum mv88e6xxx_policy_mapping mapping;
241 enum mv88e6xxx_policy_action action;
242 struct ethtool_rx_flow_spec fs;
248 struct mv88e6xxx_port {
249 struct mv88e6xxx_chip *chip;
252 u64 atu_member_violation;
253 u64 atu_miss_violation;
254 u64 atu_full_violation;
255 u64 vtu_member_violation;
256 u64 vtu_miss_violation;
257 phy_interface_t interface;
261 unsigned int serdes_irq;
262 char serdes_irq_name[64];
263 struct devlink_region *region;
266 enum mv88e6xxx_region_id {
267 MV88E6XXX_REGION_GLOBAL1 = 0,
268 MV88E6XXX_REGION_GLOBAL2,
269 MV88E6XXX_REGION_ATU,
270 MV88E6XXX_REGION_VTU,
271 MV88E6XXX_REGION_PVT,
273 _MV88E6XXX_REGION_MAX,
276 struct mv88e6xxx_region_priv {
277 enum mv88e6xxx_region_id id;
280 struct mv88e6xxx_chip {
281 const struct mv88e6xxx_info *info;
283 /* Currently configured tagging protocol */
284 enum dsa_tag_protocol tag_protocol;
286 /* The dsa_switch this private structure is related to */
287 struct dsa_switch *ds;
289 /* The device this structure is associated to */
292 /* This mutex protects the access to the switch registers */
293 struct mutex reg_lock;
295 /* The MII bus and the address on the bus that is used to
296 * communication with the switch
298 const struct mv88e6xxx_bus_ops *smi_ops;
302 /* Handles automatic disabling and re-enabling of the PHY
305 const struct mv88e6xxx_bus_ops *phy_ops;
306 struct mutex ppu_mutex;
308 struct work_struct ppu_work;
309 struct timer_list ppu_timer;
311 /* This mutex serialises access to the statistics unit.
312 * Hold this mutex over snapshot + dump sequences.
314 struct mutex stats_mutex;
316 /* A switch may have a GPIO line tied to its reset pin. Parse
317 * this from the device tree, and use it before performing
320 struct gpio_desc *reset;
322 /* set to size of eeprom if supported by the switch */
325 /* List of mdio busses */
326 struct list_head mdios;
328 /* Policy Control List IDs and rules */
331 /* There can be two interrupt controllers, which are chained
332 * off a GPIO as interrupt source
334 struct mv88e6xxx_irq g1_irq;
335 struct mv88e6xxx_irq g2_irq;
339 char device_irq_name[64];
341 char watchdog_irq_name[64];
344 char atu_prob_irq_name[64];
346 char vtu_prob_irq_name[64];
347 struct kthread_worker *kworker;
348 struct kthread_delayed_work irq_poll_work;
353 /* This cyclecounter abstracts the switch PTP time.
354 * reg_lock must be held for any operation that read()s.
356 struct cyclecounter tstamp_cc;
357 struct timecounter tstamp_tc;
358 struct delayed_work overflow_work;
360 struct ptp_clock *ptp_clock;
361 struct ptp_clock_info ptp_clock_info;
362 struct delayed_work tai_event_work;
363 struct ptp_pin_desc pin_config[MV88E6XXX_MAX_GPIO];
368 /* Current ingress and egress monitor ports */
369 int egress_dest_port;
370 int ingress_dest_port;
372 /* Per-port timestamping resources. */
373 struct mv88e6xxx_port_hwtstamp port_hwtstamp[DSA_MAX_PORTS];
375 /* Array of port structures. */
376 struct mv88e6xxx_port ports[DSA_MAX_PORTS];
378 /* devlink regions */
379 struct devlink_region *regions[_MV88E6XXX_REGION_MAX];
382 struct mv88e6xxx_bus_ops {
383 int (*read)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
384 int (*write)(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
387 struct mv88e6xxx_mdio_bus {
389 struct mv88e6xxx_chip *chip;
390 struct list_head list;
394 struct mv88e6xxx_ops {
395 /* Switch Setup Errata, called early in the switch setup to
396 * allow any errata actions to be performed
398 int (*setup_errata)(struct mv88e6xxx_chip *chip);
400 int (*ieee_pri_map)(struct mv88e6xxx_chip *chip);
401 int (*ip_pri_map)(struct mv88e6xxx_chip *chip);
403 /* Ingress Rate Limit unit (IRL) operations */
404 int (*irl_init_all)(struct mv88e6xxx_chip *chip, int port);
406 int (*get_eeprom)(struct mv88e6xxx_chip *chip,
407 struct ethtool_eeprom *eeprom, u8 *data);
408 int (*set_eeprom)(struct mv88e6xxx_chip *chip,
409 struct ethtool_eeprom *eeprom, u8 *data);
411 int (*set_switch_mac)(struct mv88e6xxx_chip *chip, u8 *addr);
413 int (*phy_read)(struct mv88e6xxx_chip *chip,
415 int addr, int reg, u16 *val);
416 int (*phy_write)(struct mv88e6xxx_chip *chip,
418 int addr, int reg, u16 val);
420 /* Priority Override Table operations */
421 int (*pot_clear)(struct mv88e6xxx_chip *chip);
423 /* PHY Polling Unit (PPU) operations */
424 int (*ppu_enable)(struct mv88e6xxx_chip *chip);
425 int (*ppu_disable)(struct mv88e6xxx_chip *chip);
427 /* Switch Software Reset */
428 int (*reset)(struct mv88e6xxx_chip *chip);
430 /* RGMII Receive/Transmit Timing Control
431 * Add delay on PHY_INTERFACE_MODE_RGMII_*ID, no delay otherwise.
433 int (*port_set_rgmii_delay)(struct mv88e6xxx_chip *chip, int port,
434 phy_interface_t mode);
436 #define LINK_FORCED_DOWN 0
437 #define LINK_FORCED_UP 1
438 #define LINK_UNFORCED -2
440 /* Port's MAC link state
441 * Use LINK_FORCED_UP or LINK_FORCED_DOWN to force link up or down,
442 * or LINK_UNFORCED for normal link detection.
444 int (*port_set_link)(struct mv88e6xxx_chip *chip, int port, int link);
446 /* Synchronise the port link state with that of the SERDES
448 int (*port_sync_link)(struct mv88e6xxx_chip *chip, int port, unsigned int mode, bool isup);
453 /* Enable/disable sending Pause */
454 int (*port_set_pause)(struct mv88e6xxx_chip *chip, int port,
457 #define SPEED_MAX INT_MAX
458 #define SPEED_UNFORCED -2
459 #define DUPLEX_UNFORCED -2
461 /* Port's MAC speed (in Mbps) and MAC duplex mode
463 * Depending on the chip, 10, 100, 200, 1000, 2500, 10000 are valid.
464 * Use SPEED_UNFORCED for normal detection, SPEED_MAX for max value.
466 * Use DUPLEX_HALF or DUPLEX_FULL to force half or full duplex,
467 * or DUPLEX_UNFORCED for normal duplex detection.
469 int (*port_set_speed_duplex)(struct mv88e6xxx_chip *chip, int port,
470 int speed, int duplex);
472 /* What interface mode should be used for maximum speed? */
473 phy_interface_t (*port_max_speed_mode)(int port);
475 int (*port_tag_remap)(struct mv88e6xxx_chip *chip, int port);
477 int (*port_set_policy)(struct mv88e6xxx_chip *chip, int port,
478 enum mv88e6xxx_policy_mapping mapping,
479 enum mv88e6xxx_policy_action action);
481 int (*port_set_frame_mode)(struct mv88e6xxx_chip *chip, int port,
482 enum mv88e6xxx_frame_mode mode);
483 int (*port_set_ucast_flood)(struct mv88e6xxx_chip *chip, int port,
485 int (*port_set_mcast_flood)(struct mv88e6xxx_chip *chip, int port,
487 int (*port_set_ether_type)(struct mv88e6xxx_chip *chip, int port,
489 int (*port_set_jumbo_size)(struct mv88e6xxx_chip *chip, int port,
492 int (*port_egress_rate_limiting)(struct mv88e6xxx_chip *chip, int port);
493 int (*port_pause_limit)(struct mv88e6xxx_chip *chip, int port, u8 in,
495 int (*port_disable_learn_limit)(struct mv88e6xxx_chip *chip, int port);
496 int (*port_disable_pri_override)(struct mv88e6xxx_chip *chip, int port);
497 int (*port_setup_message_port)(struct mv88e6xxx_chip *chip, int port);
499 /* CMODE control what PHY mode the MAC will use, eg. SGMII, RGMII, etc.
500 * Some chips allow this to be configured on specific ports.
502 int (*port_set_cmode)(struct mv88e6xxx_chip *chip, int port,
503 phy_interface_t mode);
504 int (*port_get_cmode)(struct mv88e6xxx_chip *chip, int port, u8 *cmode);
506 /* Some devices have a per port register indicating what is
507 * the upstream port this port should forward to.
509 int (*port_set_upstream_port)(struct mv88e6xxx_chip *chip, int port,
512 /* Snapshot the statistics for a port. The statistics can then
513 * be read back a leisure but still with a consistent view.
515 int (*stats_snapshot)(struct mv88e6xxx_chip *chip, int port);
517 /* Set the histogram mode for statistics, when the control registers
518 * are separated out of the STATS_OP register.
520 int (*stats_set_histogram)(struct mv88e6xxx_chip *chip);
522 /* Return the number of strings describing statistics */
523 int (*stats_get_sset_count)(struct mv88e6xxx_chip *chip);
524 int (*stats_get_strings)(struct mv88e6xxx_chip *chip, uint8_t *data);
525 int (*stats_get_stats)(struct mv88e6xxx_chip *chip, int port,
527 int (*set_cpu_port)(struct mv88e6xxx_chip *chip, int port);
528 int (*set_egress_port)(struct mv88e6xxx_chip *chip,
529 enum mv88e6xxx_egress_direction direction,
532 #define MV88E6XXX_CASCADE_PORT_NONE 0xe
533 #define MV88E6XXX_CASCADE_PORT_MULTIPLE 0xf
535 int (*set_cascade_port)(struct mv88e6xxx_chip *chip, int port);
537 const struct mv88e6xxx_irq_ops *watchdog_ops;
539 int (*mgmt_rsvd2cpu)(struct mv88e6xxx_chip *chip);
541 /* Power on/off a SERDES interface */
542 int (*serdes_power)(struct mv88e6xxx_chip *chip, int port, int lane,
545 /* SERDES lane mapping */
546 int (*serdes_get_lane)(struct mv88e6xxx_chip *chip, int port);
548 int (*serdes_pcs_get_state)(struct mv88e6xxx_chip *chip, int port,
549 int lane, struct phylink_link_state *state);
550 int (*serdes_pcs_config)(struct mv88e6xxx_chip *chip, int port,
551 int lane, unsigned int mode,
552 phy_interface_t interface,
553 const unsigned long *advertise);
554 int (*serdes_pcs_an_restart)(struct mv88e6xxx_chip *chip, int port,
556 int (*serdes_pcs_link_up)(struct mv88e6xxx_chip *chip, int port,
557 int lane, int speed, int duplex);
559 /* SERDES interrupt handling */
560 unsigned int (*serdes_irq_mapping)(struct mv88e6xxx_chip *chip,
562 int (*serdes_irq_enable)(struct mv88e6xxx_chip *chip, int port, int lane,
564 irqreturn_t (*serdes_irq_status)(struct mv88e6xxx_chip *chip, int port,
567 /* Statistics from the SERDES interface */
568 int (*serdes_get_sset_count)(struct mv88e6xxx_chip *chip, int port);
569 int (*serdes_get_strings)(struct mv88e6xxx_chip *chip, int port,
571 int (*serdes_get_stats)(struct mv88e6xxx_chip *chip, int port,
574 /* SERDES registers for ethtool */
575 int (*serdes_get_regs_len)(struct mv88e6xxx_chip *chip, int port);
576 void (*serdes_get_regs)(struct mv88e6xxx_chip *chip, int port,
579 /* Address Translation Unit operations */
580 int (*atu_get_hash)(struct mv88e6xxx_chip *chip, u8 *hash);
581 int (*atu_set_hash)(struct mv88e6xxx_chip *chip, u8 hash);
583 /* VLAN Translation Unit operations */
584 int (*vtu_getnext)(struct mv88e6xxx_chip *chip,
585 struct mv88e6xxx_vtu_entry *entry);
586 int (*vtu_loadpurge)(struct mv88e6xxx_chip *chip,
587 struct mv88e6xxx_vtu_entry *entry);
589 /* GPIO operations */
590 const struct mv88e6xxx_gpio_ops *gpio_ops;
592 /* Interface to the AVB/PTP registers */
593 const struct mv88e6xxx_avb_ops *avb_ops;
595 /* Remote Management Unit operations */
596 int (*rmu_disable)(struct mv88e6xxx_chip *chip);
598 /* Precision Time Protocol operations */
599 const struct mv88e6xxx_ptp_ops *ptp_ops;
602 void (*phylink_validate)(struct mv88e6xxx_chip *chip, int port,
604 struct phylink_link_state *state);
607 int (*set_max_frame_size)(struct mv88e6xxx_chip *chip, int mtu);
610 struct mv88e6xxx_irq_ops {
611 /* Action to be performed when the interrupt happens */
612 int (*irq_action)(struct mv88e6xxx_chip *chip, int irq);
613 /* Setup the hardware to generate the interrupt */
614 int (*irq_setup)(struct mv88e6xxx_chip *chip);
615 /* Reset the hardware to stop generating the interrupt */
616 void (*irq_free)(struct mv88e6xxx_chip *chip);
619 struct mv88e6xxx_gpio_ops {
620 /* Get/set data on GPIO pin */
621 int (*get_data)(struct mv88e6xxx_chip *chip, unsigned int pin);
622 int (*set_data)(struct mv88e6xxx_chip *chip, unsigned int pin,
625 /* get/set GPIO direction */
626 int (*get_dir)(struct mv88e6xxx_chip *chip, unsigned int pin);
627 int (*set_dir)(struct mv88e6xxx_chip *chip, unsigned int pin,
630 /* get/set GPIO pin control */
631 int (*get_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
633 int (*set_pctl)(struct mv88e6xxx_chip *chip, unsigned int pin,
637 struct mv88e6xxx_avb_ops {
638 /* Access port-scoped Precision Time Protocol registers */
639 int (*port_ptp_read)(struct mv88e6xxx_chip *chip, int port, int addr,
641 int (*port_ptp_write)(struct mv88e6xxx_chip *chip, int port, int addr,
644 /* Access global Precision Time Protocol registers */
645 int (*ptp_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
647 int (*ptp_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
649 /* Access global Time Application Interface registers */
650 int (*tai_read)(struct mv88e6xxx_chip *chip, int addr, u16 *data,
652 int (*tai_write)(struct mv88e6xxx_chip *chip, int addr, u16 data);
655 struct mv88e6xxx_ptp_ops {
656 u64 (*clock_read)(const struct cyclecounter *cc);
657 int (*ptp_enable)(struct ptp_clock_info *ptp,
658 struct ptp_clock_request *rq, int on);
659 int (*ptp_verify)(struct ptp_clock_info *ptp, unsigned int pin,
660 enum ptp_pin_function func, unsigned int chan);
661 void (*event_work)(struct work_struct *ugly);
662 int (*port_enable)(struct mv88e6xxx_chip *chip, int port);
663 int (*port_disable)(struct mv88e6xxx_chip *chip, int port);
664 int (*global_enable)(struct mv88e6xxx_chip *chip);
665 int (*global_disable)(struct mv88e6xxx_chip *chip);
677 #define STATS_TYPE_PORT BIT(0)
678 #define STATS_TYPE_BANK0 BIT(1)
679 #define STATS_TYPE_BANK1 BIT(2)
681 struct mv88e6xxx_hw_stat {
682 char string[ETH_GSTRING_LEN];
688 static inline bool mv88e6xxx_has_pvt(struct mv88e6xxx_chip *chip)
690 return chip->info->pvt;
693 static inline bool mv88e6xxx_has_lag(struct mv88e6xxx_chip *chip)
695 return !!chip->info->global2_addr;
698 static inline unsigned int mv88e6xxx_num_databases(struct mv88e6xxx_chip *chip)
700 return chip->info->num_databases;
703 static inline unsigned int mv88e6xxx_num_macs(struct mv88e6xxx_chip *chip)
705 return chip->info->num_macs;
708 static inline unsigned int mv88e6xxx_num_ports(struct mv88e6xxx_chip *chip)
710 return chip->info->num_ports;
713 static inline unsigned int mv88e6xxx_max_vid(struct mv88e6xxx_chip *chip)
715 return chip->info->max_vid;
718 static inline u16 mv88e6xxx_port_mask(struct mv88e6xxx_chip *chip)
720 return GENMASK((s32)mv88e6xxx_num_ports(chip) - 1, 0);
723 static inline unsigned int mv88e6xxx_num_gpio(struct mv88e6xxx_chip *chip)
725 return chip->info->num_gpio;
728 static inline bool mv88e6xxx_is_invalid_port(struct mv88e6xxx_chip *chip, int port)
730 return (chip->info->invalid_port_mask & BIT(port)) != 0;
733 int mv88e6xxx_read(struct mv88e6xxx_chip *chip, int addr, int reg, u16 *val);
734 int mv88e6xxx_write(struct mv88e6xxx_chip *chip, int addr, int reg, u16 val);
735 int mv88e6xxx_wait_mask(struct mv88e6xxx_chip *chip, int addr, int reg,
737 int mv88e6xxx_wait_bit(struct mv88e6xxx_chip *chip, int addr, int reg,
739 struct mii_bus *mv88e6xxx_default_mdio_bus(struct mv88e6xxx_chip *chip);
741 static inline void mv88e6xxx_reg_lock(struct mv88e6xxx_chip *chip)
743 mutex_lock(&chip->reg_lock);
746 static inline void mv88e6xxx_reg_unlock(struct mv88e6xxx_chip *chip)
748 mutex_unlock(&chip->reg_lock);
751 int mv88e6xxx_fid_map(struct mv88e6xxx_chip *chip, unsigned long *bitmap);
753 #endif /* _MV88E6XXX_CHIP_H */