Commit Graph

422 Commits

Author SHA1 Message Date
Jeremy Alves
b8fca78022 Lan743/6.1 include nvidia specific changes
Updating Lan7431 nvidia-oot driver for kernel 6.1
to include NV specific changes

Include changes from:
    https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924162
    https://git-master.nvidia.com/r/c/linux-nv-oot/+/2932422
for userland phy and SC7 support

Bug 4330040
Bug 4270736

Change-Id: I20e052f24757d0ac17501906b267bc746c3d43d2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3000975
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-10-22 03:23:41 -07:00
Laxman Dewangan
9a65689ba2 mttcan: tegra: Add new prod setting support
Add new prod setting support which is the
property based on device tree. The prod
setting of each register field are new property
in DT and prod configurations are configured
via these new properties.

Bug 4097475

Change-Id: I86adc7b72a28802d73fee8a085db2bccf0d6d1cc
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2996771
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-14 05:56:30 -07:00
Revanth Kumar Uppala
9db9eb336c nvethernet: fix compilation error with k6.4.5
Fix compilation error while building nvethernet driver with k6.4.5

Bug 4221847

Change-Id: I0f7158949da7371135e4b483aea5a0fc4dc33890
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990328
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-07 13:03:37 -07:00
Jon Hunter
ed130f099a net: nvethernet: Fix build for Linux v6.4
In Linux v6.4, commit
3948b05950fd ("net: introduce a config option to tweak MAX_SKB_FRAGS")
added a kernel config option for MAX_SKB_FRAGS and change the type of
the definition to integer. This causes the nvethernet driver build to
fail and the following errors are seen ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:5949:33: error:
  format ‘%ld’ expects argument of type ‘long int’, but argument 4
  has type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
    "invalid tx-frames, must be inrange %d to %ld",
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 drivers/net/ethernet/nvidia/nvethernet/ethtool.c:950:28: error: format
  ‘%ld’ expects argument of type ‘long int’, but argument 4 has
  type ‘nveu32_t’ {aka ‘unsigned int’} [-Werror=format=]
    "invalid tx-frames, must be in the range of"
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Fix this by changing the type in the respective prints to integer. Note
that his is also to make this change for kernel prior to Linux v6.4.

Bug 4183168
Bug 4221847

Change-Id: Ibd9160ad08e65e0b85cae1cf4903075c31a1cd77
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2989002
Reviewed-by: Shanker Donthineni <sdonthineni@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-10-05 04:37:24 -07:00
Jon Hunter
1c89d6b9cd net: r8168: Fix build for Linux v6.5
The r8168 driver fails to build with Linux v6.5 because the
skb_gso_segment() is not found ...

 drivers/net/ethernet/realtek/r8168_n.c:29231:24: error: implicit
  declaration of function ‘skb_gso_segment’; did you mean
  ‘skb_gso_reset’? [-Werror=implicit-function-declaration]
      segs = skb_gso_segment(skb, features);
             ^~~~~~~~~~~~~~~

Commit d457a0e329b0 ("net: move gso declarations and functions to their
own files") moved the definition to a new file 'net/gso.h'. Fix this by
updating the conftest Makefile to check for the presence of this header
file and use the definition generated by conftest accordingly in the
r8168 driver.

Bug 4221847

Change-Id: I6ad83a06602ef0679a76ff1a6e5ddabbcb1bfe00
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2990521
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-04 13:54:55 -07:00
Jon Hunter
ece68dd0d1 net: Use conftest
Instead of relying on kernel version to determine if functions or
specific versions of functions are present in the kernel, add compile
time tests to the conftest.sh script to determine this at compile time
for the kernel being used. This is beneficial for working with 3rd party
Linux kernels that may have back-ported upstream changes into their
kernel and so the kernel version checks do not work.

Bug 4119327

Change-Id: I79e701940ca70ca4d66500c75b5992f9d92b54b0
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2985744
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-10-03 04:01:15 -07:00
Jon Hunter
8409b7c652 net: can: mttcan: Make LED support depend on CAN_LEDS
CONFIG_CAN_LEDS has been marked as BROKEN since Linux v4.19 and was
finally removed in Linux v5.19. Only compile support for LEDS if enabled
in the kernel. Long-term we need to move the MTTCAN driver to use
LEDS_TRIGGER_NETDEV.

This is a better solution for working with 3rd party Linux kernels that
may backport upstream changes to the kernel and hence are not compatible
with these existing version checks.

Bug 4228080
Bug 4283911

Change-Id: I70e800c4a3699af59742d30111bc3a3cbf80bcb5
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2982135
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-21 13:11:36 -07:00
Jon Hunter
8f976ab022 net: can: mttcan: Drop unnecessary version checks
GPIO descriptor support has been supported in the Linux kernel since
v3.16. Therefore, simplify the MTTCAN driver by removing the legacy GPIO
support and only use GPIO descriptors.

Bug 4119327
Bug 4228080

Change-Id: Ib1c50d17c514dee6a5c69145a8f5d3e07b5b3855
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2981396
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-09-19 21:11:29 -07:00
Shobek Attupurath
4ae0f1a759 rtl8822ce: Remove unwanted prints
Issue: Realtek driver has unwanted kernel prints being dumped in
       kernel logs

Fix: Remove unwanted kernel prints and move necesary prints to
     debug

Bug 4273483

Change-Id: I0a7b0d15e9456f6bcf296cd24fe758950cc64888
Signed-off-by: Shobek Attupurath <sattupurath@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2977367
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2023-09-19 21:09:43 -07:00
Revanth Kumar Uppala
7a01b01e88 nvethernet: Resolve "Wframe-larger-than" warning
-Use dynamic structure pointer to eliminate
"Wframe-larger-than" warning.

-Modify "-Wframe-larger-than" flag from 4096 bytes to 2048 bytes

Bug 4213870

Change-Id: I9dc3df951290415ce587b1fe2440ee52dd985b62
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2954775
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-09-06 05:20:02 -07:00
Jian-Min Liu
719d3fa024 nvidia-oot: use TEGRA_SYSTEM_TYPE_ACK as ack macro
Use config TEGRA_SYSTEM_TYPE_ACK to control kernel builds only
base on the system type which also aliged to Makefile use.

Bug 4223187

Change-Id: I276208d180d1b3459eccb80d8fdb818f4507d3df
Signed-off-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2966713
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-24 23:32:04 -07:00
Revanth Kumar Uppala
37b53e8d72 r8168: update driver to 8.051.02.10m_pll
- Update realtek r8168 driver version to 8.051.02.10m_pll
- This update disables 10M EEE

Bug 4205197

Change-Id: I0d20a2d6061e108192a3066965aff94e8a463ca5
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2962412
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-23 11:17:30 -07:00
Mahesh Patil
6883238a21 nvethernet: Fix coverity "unused value"
Bug 3952896

Change-Id: Ie30c3da4d0979f664cb3c951794e905b52e5c005
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2952208
Reviewed-by: Nagaraj Annaiah <nannaiah@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Ashutosh Jha <ajha@nvidia.com>
2023-08-17 20:16:21 -07:00
Sushil Kumar Singh
8fc898d1ec nvethernet: assign macsec private data to NULL
Issue:
L4T platforms on boot comes up with MTU as 1500.
However on changing the MTU to jumbo, the final
MTU which gets set accounts the MACSEC ICV tag
len and reduces the MTU by 34 bytes even though
the platform does not support MACSEC.

Fix:
Assign macsec allocated private data to NULL and
use the NULL check in ndo mtu change ioctl call
to reject MTU reduction if macsec is not supported.

Bug 4137597

Change-Id: Ica3003b54762dd5d240c9b0c5c012049b4e503b2
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928569
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-04 13:57:42 -07:00
Jon Hunter
44443da0bb net: realtek: Fix build for Linux v6.1+
Upstream Linux kernel commit b48b89f9c189 ("net: drop the weight
argument from netif_napi_add") removes the weight argument from the
netif_napi_add() function and this is breaking the build of a few
drivers that use this function. Fix this by updating these drivers
to use the netif_napi_add_weight() function instead for Linux v6.1.

Finally, allow building the realtek wireless driver for kernels other
than v5.15 so that we can ensure it will build against other kernel
versions.

Bug 3750163

Change-Id: If179d044c00bfa83c9902973c642717263d9e3de
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942057
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-08-02 14:05:18 -07:00
Sushil Kumar Singh
0f0dc2e6c1 nvethernet: Cancel set speed workqueue on SC7 entry
set speed work function is not cancelled on system suspend
fix this by cancelling the work queue function

Bug 4167378

Change-Id: I2c065011a830470f690441b2c841893479b361fb
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921347
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-07-28 13:16:35 -07:00
Revanth Kumar Uppala
4c0d72dba6 nvethernet: Fix coverity defect
Issue:
Assigning value 0 to ret, but that stored value is overwritten
before it can be used.

Fix:
Remove unused assignment to ret

CID: 10166550

Bug 3952896

Change-Id: Ieb877e618ca252c218b338682ca02d44096c7a47
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942165
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-27 18:42:20 -07:00
Sushil Kumar Singh
cec663aa8d r8168: Fix -20C 10mbps failure in Mods test
Issue:
Ethernet mplan stability tests at -20C for 10Mbps fails with rate 15%
Basically the GPHY 10M power saving includes the below parameters,
clock speed down, pll off and reference voltage off.
During debugging it was found that enable/disable pll circuit
frequently when in 10M low data traffic (such as idle mode) may have
a corner case and plays a part in this issue repro.

Fix:
So plloff saving function should be disable (do not have to open it) for nvidia -20C mplan test case.

Bug 3946623

Change-Id: I87ab9b487fe5924ee9ee16bbb14d7f8c19f3a4e7
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2939046
Tested-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
(cherry picked from commit 80f6470d40821bfbad8f8166d22442e949b47173)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2942039
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-07-27 18:41:33 -07:00
Bhadram Varka
7cf98e614a nvethernet: return error from ether_get_tx_ts
ether_get_tx_ts, pdata->tx_ts_ref_cnt is an atomic variable
that is used as a mutex in this function and should not return 0
if the function fails to acquire the mutex.
The workqueue is scheduled when the return value of the
judgment function is <0. If one CPU core execution softirq
is running in ether_get_tx_ts function and another CPU core
softirq also calls ether_get_tx_ts function to get hardware
timestamp, then the acquisition of mutex fails and return 0.
After returning 0, the workqueue is not scheduled.
The timestamp cannot be obtained in time. So ether_get_tx_ts
should returns -1 on failure to acquire the mutex.

Bug 4150416

Change-Id: Icffd409b349d8bb8dbf5a483124b3bd3d7ef6cc8
Signed-off-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934350
Reviewed-by: Bitan Biswas <bbiswas@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-24 17:41:11 -07:00
Jon Hunter
308514c910 net: nvethernet: Fix unused variable warning
If DEBUGFS is not enabled, then the following warning is observed ...

 drivers/net/ethernet/nvidia/nvethernet/sysfs.c:3321:6:
  error: unused variable [-Werror=unused-variable]
  3321 |  int ret = 0;
       |      ^~~

Fix this by ensuring that 'ret' is only defined if the DEBUGFS is
enabled.

Bug 4190165

Change-Id: I0182874592f20abe8d53b7bfdcfd099518b23f9c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938450
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:18 -07:00
Jon Hunter
9655b8c6b0 net: nvethernet: Fix CONFIG_TEGRA_NVPPS not defined warning
Compiling the nvethernet driver without the ccflag CONFIG_TEGRA_NVPPS
defined generates the following warning ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:2936:5:
 warning: "CONFIG_TEGRA_NVPPS" is not defined, evaluates to 0 [-Wundef]
  2936 | #if CONFIG_TEGRA_NVPPS
       |     ^~~~~~~~~~~~~~~~~~

Fix this by using '#ifdef' to determine if CONFIG_TEGRA_NVPPS is
defined instead of '#if'.

Bug 4190030

Change-Id: Id1523de6f9ef9f4c72669584efb77ffd9ddf20f3
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2938375
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:47:03 -07:00
Jeremy Alves
10ac600b18 Lan743x - fix SC7 resume
Incorporate fixes from bug 4071996 and 3457173
To fix issue with userland phy driver interface
during sc7 resume

Bug 4172302

Change-Id: I827be437172ed1992baa724149fb39dd1e1f92ac
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2932422
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Praveen Ishwar Bajantri <pbajantri@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-19 08:45:52 -07:00
Jon Hunter
789890bd3e net: nvethernet: Fix compilation warning
Building the nvethernet driver generates the following warning ...

 drivers/net/ethernet/nvidia/nvethernet/ether_linux.c:6730:1: warning:
 the frame size of 3664 bytes is larger than 2048 bytes
 [-Wframe-larger-than=]

For now allow the frame size to be 4096 bytes to resolve the warning
while a proper fix is implemented.

Bug 4190030

Change-Id: I5460ec04c80458174c2c51dd0058b7cc191fe808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934698
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-17 14:37:54 -07:00
Jeremy Alves
0df8edb69b Lan743/6.1 vanilla driver of Lan7431 from upstream
Adding 6.1.9 unmodified Lan7431 driver to nvidia-oot

This is the unmodified driver from
  K6.1.9
without our NVIDIA specific changes

Bug 3978997

Signed-off-by: Jeremy Alves <jalves@nvidia.com>
Change-Id: Iaf453a1b9dc82355f8c7936823c5c90633fe24d9
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934591
Tested-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-15 08:15:52 -07:00
Jon Hunter
fa591a862a net: wireless: realtek: Fix warnings
Building the realtek wireless driver generates various warnings due to
incorrect indentation or missing curly braces. For example, the
following warnings are seen ...

 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c: In function
 ‘rtw_drv_scan_by_self’:
 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c:3167:17:
 warning: this ‘else’ clause does not guard... [-Wmisleading-indentation]
 3167 |                 else
      |                 ^~~~
 drivers/net/wireless/realtek/rtl8822ce/core/rtw_mlme.c:3170:25:
 note: ...this statement, but the latter is misleadingly indented as if
 it were guarded by the ‘else’
 3170 |                         goto exit;
      |                         ^~~~

 drivers/net/wireless/realtek/rtl8822ce/core/efuse/rtw_efuse.c:917:17:
 warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
  917 |                 if (i % 16 == 0)
      |                 ^~

Fix the indentation and add the necessary curly braces to resolve these
warnings.

Bug 4190030

Change-Id: Ic13f1470043190ffd8401581cb97c908070c2940
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2934697
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Shobek Attupurath <sattupurath@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-07-14 20:21:42 -07:00
Manish Bhardwaj
16d1e13a3b mttcan: fix compilation error for android
1. nvidia-oot/drivers/net/can/mttcan/native/../
   include/m_ttcan_linux.h:35:10:
   fatal error: 'linux/tegra_prod.h' file not found
         ^~~~~~~~~~~~~~~~~~~~
   1 error generated.

2. nvidia-oot/drivers/net/can/mttcan/hal/m_ttcan.c:330:6:
   warning: unused variable _tdcr_reg_ [-Wunused-variable]
   330 |  u32 tdcr_reg;
      |      ^~~~~~~~

Bug 4174549

Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Change-Id: I57ae8d1234745996fb1277c64c632d2d1026a870
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2928348
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Bruce Xu <brucex@nvidia.com>
Tested-by: Bruce Xu <brucex@nvidia.com>
2023-06-30 13:01:41 -07:00
Sushil Kumar Singh
6dc4368ca0 realtek: r8168: Enable r8168 pcie ethernet in k5.15
- Enable r8168 downstream pcie ethernet driver for k5.15
- Update driver version to 8.051.02
- Makefile updated to support compilation in oot repo

Bug 4080753
Bug 4097309

Change-Id: Ia5fcd99fb4701273b83bede35f4e8f4dea5c67e0
Signed-off-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2908443
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Brad Griffis <bgriffis@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
2023-06-29 18:52:05 -07:00
Manish Bhardwaj
df0489a1e0 CAN: program prod setting for tdcr register
Using this patch we are programming tdcr register
of can controllers based on the data speed.

Bug 4165928

Change-Id: I4d3f9426695b4ac19bef144f242dcf74371c00b7
Signed-off-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924921
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-28 01:58:03 -07:00
Revanth Kumar Uppala
306f33d38e nvethernet: Read instance_id irrespective of macsec.
Issue:
MGBE0 ASID is getting programmed for all the MAC instances
which inturn causing the data transfer failures.Macsec is not enable
and hence instance_id is not getting updated to the corresponding mac
instance number and hence all mac instance_id's are initialized with 0.
Since ASID programming is based on mac instance_id, all MACs are
programmed with MGBE0 MAC instance id.

Fix:
Moved reading of instance_id from DT out of macsec_probe and hence the
instance_id gets updated irrespective of MAC sec enable/disable.

Bug 4124937

Change-Id: I500ed8d3db402995488260af99ad190217ff6dd2
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2925252
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-27 09:23:14 -07:00
Jeremy Alves
ee70adda3e Lan7431- NVIDIA specific changes to Lan7431 drv
Adding NVIDIA specific changes to Lan7431
for K515 driver

These changes support "userland phy driver"

Bug 3956901

Change-Id: I0f11e3cb95742bb0bac9bec7638d03552074dd23
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924162
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2023-06-24 07:40:45 -07:00
Jon Hunter
c2c17e16c9 net: nvethernet: Fix nvethernet for Linux v6.3
Commit db1a63aed89c ("net: phy: Remove fallback to old C45 method")
removes a fallback C45 method in the MDIO bus driver. This breaks
nvethernet support for Linux v6.3 and the following errors are observed.

 failed to register MDIO bus (nvethernet_mdio_bus)
 net eth0: failed to register MDIO bus

Fix this by adding the necessary read/write_c45 callbacks in the
nvethernet driver. Note these callbacks are only supported for Linux
v6.3+ kernels.

Bug 4014315

Change-Id: Ia6ab753941db0515799657da8522f32996d0852a
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924619
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
2023-06-24 07:28:08 -07:00
Abhijit
16a076bf64 net: can: mttcan: fix mttcan close in case of PXE
When mttcan
- is set into DAR (Disable Automatic Retransmission) mode
- and Protocol Exception Handling is enabled
- and PXE (Protocol Exeception Event) is generated
then no TCF (Transmission cancellation Finished) event is generated.
This leads to mismatch between internal driver state and mttcan HW
state. This results in "no buffer space available" error.

This patch clears the driver internal state in close callback to
handle this situation.

Bug 200502350

Change-Id: Ie9f8fcc902a8d9b6c65662888904be5ad9aae49e
Signed-off-by: Abhijit <abhijit@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2854706
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2921328
Tested-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Manish Bhardwaj <mbhardwaj@nvidia.com>
Reviewed-by: Suresh Venkatachalam <skathirampat@nvidia.com>
Reviewed-by: Sandeep Trasi <strasi@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-24 07:26:26 -07:00
Laxman Dewangan
0ea187142e Makefile: Add missing license files
Add lincese and copyright information on Makefile
where it is missing.

Bug 4078035

Change-Id: I4d44143c186a30aabacb706b7db6549131c6e4d6
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2924242
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-22 23:39:23 -07:00
Jeremy Alves
c00985b068 Lan7431 - vanilla driver of Lan7431 from upstream
Adding unmodified Lan7431 driver to nvidia-oot

This is the unmodified driver from
  K5.15.110
  from commit cd612ec8f71740b0fc9f47d3356b23561b5761dc

For future kernels we'll need to add the driver sources
from the respective kernel

Bug 3956901

Change-Id: I376c63ceeb6aeab9ce5d17dcd3c09401217c576a
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2920947
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Jeremy Alves <jalves@nvidia.com>
Reviewed-by: Sumeet Gupta <sumeetg@nvidia.com>
2023-06-22 11:10:09 -07:00
Ankita Garg
7c81eb1b54 nvethernet: Fix build error when !OSI_STRIPPED_LIB
ioctl_data and osi_core are defined only when !OSI_STRIPPED_LIB. Fix
error in the code that accesses these variables outside the #ifndef

Bug 3974840

Change-Id: Ib0219dd0f7d9517bee2bec00ee7c546fd6e210e5
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2917512
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Srinivas Ramachandran <srinivasra@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-14 22:56:06 -07:00
Ankita Garg
42aca030bf nvethernet: Fix build error with clang
When building module with clang, -mno-outline-atomics compiler option
is not recognized

Signed-off-by: Ankita Garg <ankitag@nvidia.com>
Change-Id: Ia46702ec3be8552f830c91f53da63a99bd749af2
(cherry picked from commit 43e30d3a3d80d1455a9020490f5e164f3bd77a2b)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2891855
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Jian-Min Liu <jianminl@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Jian-Min Liu <jianminl@nvidia.com>
2023-06-13 00:18:02 -07:00
Jon Hunter
6475ddcf3d net: nvethernet: Allow driver to be built without NVPPS
The nvethernet driver has a dependency on the NVPPS driver which in
turn has a dependency on the GTE driver. The GTE driver is being
transitioned to the new upstream HTE driver and while this transition is
on-going, allow the nvethernet driver to be distributed and built
without NVPPS and GTE.

Note that by default the dependency on the NVPPS driver is enabled by
setting CONFIG_TEGRA_NVPPS to 'y'. Only if the user sets
CONFIG_TEGRA_NVPPS to 'n' will it be disabled.

Bug 3918941
Bug 3961133

Change-Id: I019e5ebfddfcb158b0a684d2eacc404231577166
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913273
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-07 22:06:16 -07:00
Jon Hunter
de1bf0e728 net: nvethernet: Remove ivc_ext.h
The ivc_ext.h is not needed by the nvethernet driver and so remove this
header so that we do not need to distribute this header for building
nvethernet.

Bug 3918941

Change-Id: Ic95d6cdc8afebaa3f8e2bdf85ca63e636c05d86c
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2913272
Reviewed-by: Revanth Kumar Uppala <ruppala@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-07 22:06:11 -07:00
Ankita Garg
c74e091fc8 rtl8822ce: Disable driver in android
Disable wireless driver rtl8822ce in android to avoid build error
when building Android Common Kernel (ACK) using clang

Bug 3974840

Change-Id: If7d11a9812e017178335de5fcd501db8e09de423
Signed-off-by: Ankita Garg <ankitag@nvidia.com>
(cherry picked from commit 3391f471559a3e9e0cb68b502a29ff2f637e7b31)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2910050
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-06-03 19:16:47 -07:00
Akshay Tigga
75ac42b84c WAR: Add "VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver"
Android common kernel prevents the use of symbols exported from the
fs subsystem in other modules. As a WAR we need to explicity import
"VFS_internal_I_am_really_a_filesystem_and_am_NOT_a_driver"
until the migration is complete to remove the use of such symbols.

Bug 3974840

Change-Id: Icb47eba34d069ec287e5ad5bd2e046b0f96f401c
Signed-off-by: Bruce Xu <brucex@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2901632
(cherry picked from commit bfd7dc903f050f778f105af07e4ddfbde8497881)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2910053
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
Tested-by: Shardar Mohammed <smohammed@nvidia.com>
2023-05-29 03:55:46 -07:00
brucex
1ce0ed3f5b tegra_hv_net: Fix wrong var type
mac_address is defined wrongly and it does not
match the return type of function of_get_mac_address.

Bug 3974840

Signed-off-by: Bruce Xu <brucex@nvidia.com>
Change-Id: I582c3755b0e2121b2e937dc77b3f9af8694e4357
(cherry picked from commit 8f8de48950266048eaf142cbdec66b1b7ccf0737)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2859221
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: Shardar Mohammed <smohammed@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Shardar Mohammed <smohammed@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-29 03:55:37 -07:00
Revanth Kumar Uppala
0a8365166e nvethernet:Fix compilation errors in Linux safety
Issue:
Observed below compilation issues
on the nvethernet driver for DRIVE Linux safety
builds as some macros/functions are defined with
"OSI_STRIPPED_LIB" protection but they are used
directly without any protection.

1./automotive-dev-main-20230516T005516255/out/embedded-linux-generic-release-safety/nvidia/kernel-rt_patches-nvidia-oot/nvidia-oot/drivers/net/ethernet/nvidia/nvethernet/sysfs.c:2641:33: error: ‘OSI_INSTANCE_ID_EQOS’ undeclared (first use in this function)
 2641 |    if (osi_core->instance_id == OSI_INSTANCE_ID_EQOS)
      |                                 ^~~~~~~~~~~~~~~~~~~~

2./automotive-dev-main-20230516T005516255/out/embedded-linux-generic-release-safety/nvidia/kernel-rt_patches-nvidia-oot/nvidia-oot/drivers/net/ethernet/nvidia/nvethernet/sysfs.c:2733:3: error: ‘dev_attr_hsi_enable’ undeclared here (not in a function)
 2733 |  &dev_attr_hsi_enable.attr,
      |   ^~~~~~~~~~~~~~~~~~~

Fix:
Add OSI_STRIPPED_LIB macro protection
for required functions.

Bug 3959085

Change-Id: Ifef1c72b5ddedc4d550280eace305bbade290bbf
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2905357
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-18 23:46:40 -07:00
Revanth Kumar Uppala
98b2b3ff4f nvethernet: Skip the device resume via mdio bus
Enable "phydev->mac_managed_pm" so that device
won't be resumed for second time via mdio bus

Bug 4071996

Change-Id: Ib35bc1459bd882a2b940d4f28bd9d2c76719bfc7
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2901540
Reviewed-by: Bhadram Varka <vbhadram@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-18 23:41:10 -07:00
Revanth Kumar Uppala
b23abb0c87 nvethernet: Resolve compilation warnings on kernels 5.17+
dev_addr present in struct net_device is made const
from K5.17. So, typecasting it to "nveu8_t * const" while
passing it to the osi_macsec_init().

Bug 4076818

Change-Id: I4b2ac2b1a033bc41af5174da29ff9867fe4df89f
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2900162
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Sanath Kumar Gampa <sgampa@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-10 13:53:44 -07:00
Revanth Kumar Uppala
8229868ec8 nvethernet: Address dev_addr warnings in K5.17
dev_addr present in struct net_device is made const
from K5.17.So, modifying the local pointer also
to const.

Bug 4076818

Change-Id: I7f2f0a5fab033a13145a0d5a60f2847d239cedb4
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2898041
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Jonathan Hunter <jonathanh@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-04 11:49:49 -07:00
Revanth Kumar Uppala
2c2e1dfb9e nvethernet: Correct the if-else condition to copy mac address
Address setting helpers are used to copy mac address from K5.17
as netdev->dev_addr is constant from K5.17.Adding an else condition
now so that memcpy will be used for Kernel versions below K5.17

Bug 4076818

Change-Id: I1542a82710aa2bdf12bfc93fdaedf31d34df91b2
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2897883
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:49:06 -07:00
Narayan Reddy
d1f735fe0d nvethernet: remove explicit addition of vlan prio
Issue: skb_vlan_tag_get gives only the VLAN_ID for
the earlier kernel versions (K4.9) and hence added
a logic to take care of adding the VLAN priority
explicitly and hence the VLAN priority getting
modified in a newer kernel version where VLAN PRIO is
already included

Fix: remove the logic of explicit adding of VLAN
priority.

Bug 3788862
Bug 4088361

Change-Id: I0ac9ebfe21d3e696ac1b0f6ba540c010928f775f
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2806468
(cherry picked from commit 799b17fc35f3bc3ec75ea93452c03bd52ed28527)
Signed-off-by: Narayan Reddy <narayanr@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2895043
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:36:02 -07:00
Om Prakash Singh
4d63a3e291 nvethernet: avoid enabling HSI from sysfs
avoid enabling HSI from sysfs when virtualization is enabled.
HSI feature is enabled from ethernet-server.

Bug 3590939
Bug 4088361

Change-Id: Icd572efb24379fc8d2fc10ab1faaf0a764ee9679
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2784216
(cherry picked from commit e0754b34892b27b2577bc81ec06dd76efe81b378)
Signed-off-by: Om Prakash Singh <omp@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2897229
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-04 11:35:52 -07:00
Mahesh Patil
448ee57dbc nvethernet: Clean up UPDATED_PAD_CAL macro
Bug 2831220
Bug 3500401
Bug 4088361

Change-Id: I2d805d5f16be91c2d213298fc3a5353f6fde001d
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2847060
(cherry picked from commit b06ce7098a503ac1f0aed586089c9e2c4e0235b8)
Signed-off-by: Mahesh Patil <maheshp@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2897235
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
2023-05-04 11:35:47 -07:00
Bibhay Ranjan
11cf87fd65 nvethernet: remove OSI controlled CFLAGS
All the common cflags will be controlled by OSI

Bug 3759976
Bug 4088361

Change-Id: I97945270c034e00f2ca160697824cdedb8402f54
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2808843
(cherry picked from commit dea31bfcefa03ab3989bd2a3b25aee804eab559c)
Signed-off-by: Bibhay Ranjan <bibhayr@nvidia.com>
Signed-off-by: Revanth Kumar Uppala <ruppala@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/2897234
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-04 11:35:37 -07:00