Switchtec Userspace  PROJECT_NUMBER = PROJECT_NUMBER=PROJECT_NUMBER = 2.2
gasops.h
1 /*
2  * Microsemi Switchtec(tm) PCIe Management Library
3  * Copyright (c) 2017, Microsemi Corporation
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a
6  * copy of this software and associated documentation files (the "Software"),
7  * to deal in the Software without restriction, including without limitation
8  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9  * and/or sell copies of the Software, and to permit persons to whom the
10  * Software is furnished to do so, subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included
13  * in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
19  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21  * OTHER DEALINGS IN THE SOFTWARE.
22  *
23  */
24 
25 #ifndef LIBSWITCHTEC_GASOPS_H
26 #define LIBSWITCHTEC_GASOPS_H
27 
28 #include "switchtec/switchtec.h"
29 #include "../switchtec_priv.h"
30 
31 int gasop_access_check(struct switchtec_dev *dev);
32 void gasop_set_partition_info(struct switchtec_dev *dev);
33 int gasop_cmd(struct switchtec_dev *dev, uint32_t cmd,
34  const void *payload, size_t payload_len, void *resp,
35  size_t resp_len);
36 int gasop_get_device_id(struct switchtec_dev *dev);
37 int gasop_get_fw_version(struct switchtec_dev *dev, char *buf,
38  size_t buflen);
39 int gasop_pff_to_port(struct switchtec_dev *dev, int pff,
40  int *partition, int *port);
41 int gasop_port_to_pff(struct switchtec_dev *dev, int partition,
42  int port, int *pff);
43 int gasop_flash_part(struct switchtec_dev *dev,
44  struct switchtec_fw_image_info *info,
45  enum switchtec_fw_image_part_id_gen3 part);
46 int gasop_event_summary(struct switchtec_dev *dev,
47  struct switchtec_event_summary *sum);
48 int gasop_event_ctl(struct switchtec_dev *dev, enum switchtec_event_id e,
49  int index, int flags, uint32_t data[5]);
50 int gasop_event_wait_for(struct switchtec_dev *dev,
51  enum switchtec_event_id e, int index,
52  struct switchtec_event_summary *res,
53  int timeout_ms);
54 
55 #endif
switchtec_event_id
Enumeration of all possible events.
Definition: switchtec.h:265
Information about a firmware image or partition.
Definition: switchtec.h:213
Event summary bitmaps.
Definition: switchtec.h:250
Main Switchtec header.
unsigned pff[SWITCHTEC_MAX_PFF_CSR]
Bitmap of events in each port function.
Definition: switchtec.h:259
unsigned part[SWITCHTEC_MAX_PARTS]
Bitmap of events in each partition.
Definition: switchtec.h:256