diff mbox series

[net,v1] ice: Add set_termios tty operations handle to GNSS

Message ID 20220823192429.17881-1-michal.michalik@intel.com
State Changes Requested
Delegated to: Anthony Nguyen
Headers show
Series [net,v1] ice: Add set_termios tty operations handle to GNSS | expand

Commit Message

Michal Michalik Aug. 23, 2022, 7:24 p.m. UTC
Some third party tools (ex. ubxtool) tries to change GNSS TTY parameters
(ex. speed). While being optional implementation, without set_termios
handle this operation fails and prevent those third party tools from
working. TTY interface in ice driver is virtual and don't need any change
on set_termios, so is left empty. Add this mock to support all Linux TTY
APIs.

Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
Signed-off-by: Michal Michalik <michal.michalik@intel.com>
---
 drivers/net/ethernet/intel/ice/ice_gnss.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

Comments

G, GurucharanX Aug. 26, 2022, 2:06 p.m. UTC | #1
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> Michal Michalik
> Sent: Wednesday, August 24, 2022 12:54 AM
> To: intel-wired-lan@lists.osuosl.org
> Subject: [Intel-wired-lan] [PATCH net v1] ice: Add set_termios tty operations
> handle to GNSS
> 
> Some third party tools (ex. ubxtool) tries to change GNSS TTY parameters
> (ex. speed). While being optional implementation, without set_termios
> handle this operation fails and prevent those third party tools from working.
> TTY interface in ice driver is virtual and don't need any change on
> set_termios, so is left empty. Add this mock to support all Linux TTY APIs.
> 
> Fixes: 43113ff73453 ("ice: add TTY for GNSS module for E810T device")
> Signed-off-by: Michal Michalik <michal.michalik@intel.com>
> ---
>  drivers/net/ethernet/intel/ice/ice_gnss.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 

Tested-by: Gurucharan <gurucharanx.g@intel.com> (A Contingent worker at Intel)
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ice/ice_gnss.c b/drivers/net/ethernet/intel/ice/ice_gnss.c
index b5a7f24..c2dc5e5 100644
--- a/drivers/net/ethernet/intel/ice/ice_gnss.c
+++ b/drivers/net/ethernet/intel/ice/ice_gnss.c
@@ -404,11 +404,26 @@  static unsigned int ice_gnss_tty_write_room(struct tty_struct *tty)
 	return ICE_GNSS_TTY_WRITE_BUF;
 }
 
+/**
+ * ice_gnss_tty_set_termios - mock for set_termios tty operations
+ * @tty: pointer to the tty_struct
+ * @new_termios: pointer to the new termios parameters
+ */
+static void
+ice_gnss_tty_set_termios(struct tty_struct *tty, struct ktermios *new_termios)
+{
+	/* Some 3rd party tools (ex. ubxtool) want to change the TTY parameters.
+	 * In our virtual interface (I2C communication over FW AQ) we don't have
+	 * to change anything, but we need to implement it to unblock tools.
+	 */
+}
+
 static const struct tty_operations tty_gps_ops = {
 	.open =		ice_gnss_tty_open,
 	.close =	ice_gnss_tty_close,
 	.write =	ice_gnss_tty_write,
 	.write_room =	ice_gnss_tty_write_room,
+	.set_termios =  ice_gnss_tty_set_termios,
 };
 
 /**