ONLP
Open Network Linux Platform APIs
sfpi.h
Go to the documentation of this file.
1 /************************************************************
2  * <bsn.cl fy=2014 v=onl>
3  *
4  * Copyright 2014, 2015 Big Switch Networks, Inc.
5  *
6  * Licensed under the Eclipse Public License, Version 1.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License. You may obtain a copy of the License at
9  *
10  * http://www.eclipse.org/legal/epl-v10.html
11  *
12  * Unless required by applicable law or agreed to in writing,
13  * software distributed under the License is distributed on an
14  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
15  * either express or implied. See the License for the specific
16  * language governing permissions and limitations under the
17  * License.
18  *
19  * </bsn.cl>
20  ********************************************************/
31 #ifndef __ONLP_SFPI_H__
32 #define __ONLP_SFPI_H__
33 
34 #include <onlp/onlp_config.h>
35 #include <onlp/sfp.h>
36 #include <sff/sff.h>
37 
41 int onlp_sfpi_sw_init(void);
42 
47 int onlp_sfpi_hw_init(uint32_t flags);
48 
55 int onlp_sfpi_sw_denit(void);
56 
57 
63 
70 
79 
85 
91 
92 
102 int onlp_sfpi_dev_read(onlp_oid_id_t id, int devaddr, int addr,
103  uint8_t* dst, int len);
104 
105 
114 int onlp_sfpi_dev_write(onlp_oid_id_t id, int devaddr, int addr,
115  uint8_t* src, int len);
116 
124 int onlp_sfpi_dev_readb(onlp_oid_id_t id, int devaddr, int addr);
125 
133 int onlp_sfpi_dev_writeb(onlp_oid_id_t id, int devaddr, int addr,
134  uint8_t value);
135 
143 int onlp_sfpi_dev_readw(onlp_oid_id_t id, int devaddr, int addr);
144 
152 int onlp_sfpi_dev_writew(onlp_oid_id_t id, int devaddr, int addr,
153  uint16_t value);
154 
163 int onlp_sfpi_post_insert(onlp_oid_id_t id, sff_info_t* info);
164 
175  onlp_sfp_control_t control, int* rv);
176 
184  int value);
185 
193  int* value);
194 
204 int onlp_sfpi_port_map(onlp_oid_id_t id, int* rport);
205 
206 
213 
214 #endif /* __ONLP_SFPI_H__ */
215 /* @} */
onlp Configuration Header
int onlp_sfpi_dev_write(onlp_oid_id_t id, int devaddr, int addr, uint8_t *src, int len)
Write bytes to the target device on the given SFP port.
int onlp_sfpi_presence_bitmap_get(onlp_sfp_bitmap_t *dst)
Return the presence bitmap for all SFP ports.
SFP Management Interface.
int onlp_sfpi_post_insert(onlp_oid_id_t id, sff_info_t *info)
Perform any actions required after an SFP is inserted.
int onlp_sfpi_dev_writew(onlp_oid_id_t id, int devaddr, int addr, uint16_t value)
Write a word to the target device on the given SFP port.
int onlp_sfpi_dev_readw(onlp_oid_id_t id, int devaddr, int addr)
Read a word from the target device on the given SFP port.
int onlp_sfpi_sw_denit(void)
Deinitialize the chassis software module.
int onlp_sfpi_hw_init(uint32_t flags)
Hardware initialization of the SFP module.
int onlp_sfpi_type_get(onlp_oid_id_t id, onlp_sfp_type_t *rtype)
Determine the SFP connector type.
int onlp_sfpi_bitmap_get(onlp_sfp_bitmap_t *bmap)
Get the bitmap of SFP-capable port numbers.
uint32_t onlp_oid_id_t
Definition: oids.h:55
int onlp_sfpi_hdr_get(onlp_oid_id_t id, onlp_oid_hdr_t *hdr)
Get the SFP&#39;s OID header.
int onlp_sfpi_is_present(onlp_oid_id_t id)
Determine if an SFP is present.
aim_bitmap256_t onlp_sfp_bitmap_t
Definition: sfp.h:138
int onlp_sfpi_dev_writeb(onlp_oid_id_t id, int devaddr, int addr, uint8_t value)
Write a byte to the target device on the given SFP port.
int onlp_sfpi_port_map(onlp_oid_id_t id, int *rport)
Remap SFP user SFP port numbers before calling the SFPI interface.
int onlp_sfpi_control_get(onlp_oid_id_t id, onlp_sfp_control_t control, int *value)
Get an SFP control.
int onlp_sfpi_control_supported(onlp_oid_id_t id, onlp_sfp_control_t control, int *rv)
Returns whether or not the given control is supported on the given port.
enum onlp_sfp_type_e onlp_sfp_type_t
int onlp_sfpi_dev_read(onlp_oid_id_t id, int devaddr, int addr, uint8_t *dst, int len)
Read bytes from the target device on the given SFP port.
enum onlp_sfp_control_e onlp_sfp_control_t
int onlp_sfpi_dev_readb(onlp_oid_id_t id, int devaddr, int addr)
Read a byte from the target device on the given SFP port.
int onlp_sfpi_rx_los_bitmap_get(onlp_sfp_bitmap_t *dst)
Return the RX_LOS bitmap for all SFP ports.
int onlp_sfpi_sw_init(void)
Software initialization of the SFP module.
int onlp_sfpi_control_set(onlp_oid_id_t id, onlp_sfp_control_t control, int value)
Set an SFP control.
Definition: oids.h:296