Switchtec Userspace  PROJECT_NUMBER = 3.1
index.md
1 Introduction {#mainpage}
2 =================================
3 
4 This is the documentation for the Switchtec Userspace project. The userspace
5 project consists of a command line interface (CLI) program which provides a
6 simple way to perform the most common maintenance operations. The CLI makes
7 use of the userspace library (libswitchtec) which is also included in
8 this project and provides an API interface for all the commands the CLI can do
9 as well as interfaces for writing custom or other unimplemented commands.
10 The library communicates with the kernel space drivers ([switchtec-kernel] for
11 Linux and switchtec-kmdf for windows) which are documented in their respective
12 packages. A block diagram showing the relationships between the components is
13 given below.
14 
15 ![Block Diagram][blockdiagram]
16 
17 It's important to note that, on Linux, the driver does not provide direct access
18 to the GAS registers and this accesses is obtained when necessary through the
19 PCI resource file in SYSFS. Because of this, GAS accesss requires full root
20 privileges where as all normal operations only requires permissions access
21 to the device file. This is a good thing seeing direct GAS access has many
22 security implications and can be dangerous for applications to directly
23 access.
24 
25 The Windows kernel driver, on the other hand, was designed as a thin driver
26 with all GAS accesses being done in the userspace library. This was mostly
27 done to ease future development on I2C/TWI and Ethernet interfaces which
28 will always have direct access to the GAS.
29 
30 
31 [blockdiagram]: switchtec.svg
32 [switchtec-kernel]: https://github.com/Microsemi/switchtec-kernel
33 
34 
35 Switchtec Library
36 ===================
37 
38 To get started using the library you may refer to the examples provided
39 in the examples folder of the switchtec-user repository. The APIs are also
40 documented herein. Basic functions to open a handle to a device and perform
41 custom MRPC commands are documented in the [Device API]. Additional APIs
42 for other functionality can be browsed in the [Modules] section.
43 
44 
45 [device api]: @ref Device
46 [modules]: modules.html