Switchtec Userspace PROJECT_NUMBER = 4.0
Loading...
Searching...
No Matches
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
31int gasop_access_check(struct switchtec_dev *dev);
32void gasop_set_partition_info(struct switchtec_dev *dev);
33int gasop_cmd(struct switchtec_dev *dev, uint32_t cmd,
34 const void *payload, size_t payload_len, void *resp,
35 size_t resp_len);
36int gasop_get_device_id(struct switchtec_dev *dev);
37int gasop_get_fw_version(struct switchtec_dev *dev, char *buf,
38 size_t buflen);
39int gasop_pff_to_port(struct switchtec_dev *dev, int pff,
40 int *partition, int *port);
41int gasop_port_to_pff(struct switchtec_dev *dev, int partition,
42 int port, int *pff);
43int gasop_flash_part(struct switchtec_dev *dev,
44 struct switchtec_fw_image_info *info,
45 enum switchtec_fw_image_part_id_gen3 part);
46int gasop_event_summary(struct switchtec_dev *dev,
47 struct switchtec_event_summary *sum);
48int gasop_event_ctl(struct switchtec_dev *dev, enum switchtec_event_id e,
49 int index, int flags, uint32_t data[5]);
50int 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
Event summary bitmaps.
Definition: switchtec.h:289
Information about a firmware image or partition.
Definition: switchtec.h:252
Main Switchtec header.
switchtec_event_id
Enumeration of all possible events.
Definition: switchtec.h:304