Skip to content

Commit c7ef822

Browse files
kubalewskidavem330
authored andcommitted
ice: use GNSS subsystem instead of TTY
Previously support for GNSS was implemented as a TTY driver, it allowed to access GNSS receiver on /dev/ttyGNSS_<bus><func>. Use generic GNSS subsystem API instead of implementing own TTY driver. The receiver is accessible on /dev/gnss<id>. In case of multiple receivers in the OS, correct device can be found by enumerating either: - /sys/class/net/<eth port>/device/gnss/ - /sys/class/gnss/gnss<id>/device/ Using GNSS subsystem is superior to implementing own TTY driver, as the GNSS subsystem was designed solely for this purpose. It also implements TTY driver but in a common and defined way. From user perspective, there is no difference in communicating with a device, except new path to the device shall be used. The device will provide same information to the userspace as the old one, and can be used in the same way, i.e.: old # gpsmon /dev/ttyGNSS_2100_0 new # gpsmon /dev/gnss0 There is no other impact on userspace tools. User expecting onboard GNSS receiver support is required to enable CONFIG_GNSS=y/m in kernel config. Reviewed-by: Alexander Lobakin <[email protected]> Signed-off-by: Karol Kolacinski <[email protected]> Signed-off-by: Michal Michalik <[email protected]> Signed-off-by: Arkadiusz Kubalewski <[email protected]> Tested-by: Gurucharan G <[email protected]> (A Contingent worker at Intel) Signed-off-by: Tony Nguyen <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 498fe81 commit c7ef822

File tree

6 files changed

+158
-264
lines changed

6 files changed

+158
-264
lines changed

Documentation/networking/device_drivers/ethernet/intel/ice.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -901,15 +901,17 @@ To enable/disable UDP Segmentation Offload, issue the following command::
901901

902902
# ethtool -K <ethX> tx-udp-segmentation [off|on]
903903

904+
904905
GNSS module
905906
-----------
906-
Allows user to read messages from the GNSS module and write supported commands.
907-
If the module is physically present, driver creates 2 TTYs for each supported
908-
device in /dev, ttyGNSS_<device>:<function>_0 and _1. First one (_0) is RW and
909-
the second one is RO.
910-
The protocol of write commands is dependent on the GNSS module as the driver
911-
writes raw bytes from the TTY to the GNSS i2c. Please refer to the module
912-
documentation for details.
907+
Requires kernel compiled with CONFIG_GNSS=y or CONFIG_GNSS=m.
908+
Allows user to read messages from the GNSS hardware module and write supported
909+
commands. If the module is physically present, a GNSS device is spawned:
910+
``/dev/gnss<id>``.
911+
The protocol of write command is dependent on the GNSS hardware module as the
912+
driver writes raw bytes by the GNSS object to the receiver through i2c. Please
913+
refer to the hardware GNSS module documentation for configuration details.
914+
913915

914916
Performance Optimization
915917
========================

drivers/net/ethernet/intel/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ config ICE_HWTS
337337
the PTP clock driver precise cross-timestamp ioctl
338338
(PTP_SYS_OFFSET_PRECISE).
339339

340+
config ICE_GNSS
341+
def_bool GNSS = y || GNSS = ICE
342+
340343
config FM10K
341344
tristate "Intel(R) FM10000 Ethernet Switch Host Interface Support"
342345
default n

drivers/net/ethernet/intel/ice/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ ice-$(CONFIG_PCI_IOV) += \
4343
ice_vf_vsi_vlan_ops.o \
4444
ice_vf_lib.o
4545
ice-$(CONFIG_PTP_1588_CLOCK) += ice_ptp.o ice_ptp_hw.o
46-
ice-$(CONFIG_TTY) += ice_gnss.o
4746
ice-$(CONFIG_DCB) += ice_dcb.o ice_dcb_nl.o ice_dcb_lib.o
4847
ice-$(CONFIG_RFS_ACCEL) += ice_arfs.o
4948
ice-$(CONFIG_XDP_SOCKETS) += ice_xsk.o
5049
ice-$(CONFIG_ICE_SWITCHDEV) += ice_eswitch.o
50+
ice-$(CONFIG_ICE_GNSS) += ice_gnss.o

drivers/net/ethernet/intel/ice/ice.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <linux/avf/virtchnl.h>
4040
#include <linux/cpu_rmap.h>
4141
#include <linux/dim.h>
42+
#include <linux/gnss.h>
4243
#include <net/pkt_cls.h>
4344
#include <net/tc_act/tc_mirred.h>
4445
#include <net/tc_act/tc_gact.h>
@@ -565,9 +566,8 @@ struct ice_pf {
565566
struct mutex adev_mutex; /* lock to protect aux device access */
566567
u32 msg_enable;
567568
struct ice_ptp ptp;
568-
struct tty_driver *ice_gnss_tty_driver;
569-
struct tty_port *gnss_tty_port[ICE_GNSS_TTY_MINOR_DEVICES];
570-
struct gnss_serial *gnss_serial[ICE_GNSS_TTY_MINOR_DEVICES];
569+
struct gnss_serial *gnss_serial;
570+
struct gnss_device *gnss_dev;
571571
u16 num_rdma_msix; /* Total MSIX vectors for RDMA driver */
572572
u16 rdma_base_vector;
573573

0 commit comments

Comments
 (0)