Merge Official Source

Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
Tianling Shen 2024-07-29 12:51:22 +08:00
commit 5c8519b3ab
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
50 changed files with 446 additions and 214 deletions

View File

@ -1,2 +1,2 @@
LINUX_VERSION-5.15 = .162
LINUX_KERNEL_HASH-5.15.162 = 91bfc0ea152ce7b102a0b79d35a7c92843874ebf085c99d2ba8b4d85e62b1a7c
LINUX_VERSION-5.15 = .163
LINUX_KERNEL_HASH-5.15.163 = 025fc7d8b1560cf456ccae50591fe1ca21c990645df9791aed25820fe78db302

View File

@ -126,7 +126,7 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
static void ptm_tx_timeout(struct net_device *);
#else
@ -247,7 +247,7 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_do_ioctl = ptm_ioctl,
.ndo_siocdevprivate = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
@ -452,7 +452,7 @@ PTM_HARD_START_XMIT_FAIL:
return NETDEV_TX_OK;
}
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd)
{
int ndev;
@ -462,45 +462,45 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
switch ( cmd )
{
case IFX_PTM_MIB_CW_GET:
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = WAN_MIB_TABLE[ndev].wrx_nonidle_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = WAN_MIB_TABLE[ndev].wrx_idle_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = WAN_MIB_TABLE[ndev].wrx_err_cw;
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = 0;
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = 0;
break;
case IFX_PTM_MIB_FRAME_GET:
((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
((PTM_FRAME_MIB_T *)ifr->ifr_data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
((PTM_FRAME_MIB_T *)data)->RxCorrect = WAN_MIB_TABLE[ndev].wrx_correct_pdu;
((PTM_FRAME_MIB_T *)data)->TC_CrcError = WAN_MIB_TABLE[ndev].wrx_tccrc_err_pdu;
((PTM_FRAME_MIB_T *)data)->RxDropped = WAN_MIB_TABLE[ndev].wrx_nodesc_drop_pdu + WAN_MIB_TABLE[ndev].wrx_len_violation_drop_pdu;
((PTM_FRAME_MIB_T *)data)->TxSend = WAN_MIB_TABLE[ndev].wtx_total_pdu;
break;
case IFX_PTM_CFG_GET:
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = CFG_ETH_EFMTC_CRC->rx_eth_crc_present;
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = CFG_ETH_EFMTC_CRC->rx_eth_crc_check;
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = CFG_ETH_EFMTC_CRC->rx_tc_crc_check;
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = CFG_ETH_EFMTC_CRC->rx_tc_crc_len;
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = CFG_ETH_EFMTC_CRC->tx_eth_crc_gen;
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = CFG_ETH_EFMTC_CRC->tx_tc_crc_gen;
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = CFG_ETH_EFMTC_CRC->tx_tc_crc_len;
break;
case IFX_PTM_CFG_SET:
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent ? 1 : 0;
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen == 32) )
CFG_ETH_EFMTC_CRC->rx_eth_crc_present = ((IFX_PTM_CFG_T *)data)->RxEthCrcPresent ? 1 : 0;
CFG_ETH_EFMTC_CRC->rx_eth_crc_check = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck && (((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->RxTcCrcLen == 32) )
{
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 1;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->RxTcCrcLen;
}
else
{
CFG_ETH_EFMTC_CRC->rx_tc_crc_check = 0;
CFG_ETH_EFMTC_CRC->rx_tc_crc_len = 0;
}
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen == 32) )
CFG_ETH_EFMTC_CRC->tx_eth_crc_gen = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 1 : 0;
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen && (((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 16 || ((IFX_PTM_CFG_T *)data)->TxTcCrcLen == 32) )
{
CFG_ETH_EFMTC_CRC->tx_tc_crc_gen = 1;
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen;
CFG_ETH_EFMTC_CRC->tx_tc_crc_len = ((IFX_PTM_CFG_T *)data)->TxTcCrcLen;
}
else
{

View File

@ -76,7 +76,7 @@ static int ptm_stop(struct net_device *);
static unsigned int ptm_poll(int, unsigned int);
static int ptm_napi_poll(struct napi_struct *, int);
static int ptm_hard_start_xmit(struct sk_buff *, struct net_device *);
static int ptm_ioctl(struct net_device *, struct ifreq *, int);
static int ptm_ioctl(struct net_device *, struct ifreq *, void __user *, int);
#if LINUX_VERSION_CODE < KERNEL_VERSION(5,6,0)
static void ptm_tx_timeout(struct net_device *);
#else
@ -120,7 +120,7 @@ static struct net_device_ops g_ptm_netdev_ops = {
.ndo_start_xmit = ptm_hard_start_xmit,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
.ndo_do_ioctl = ptm_ioctl,
.ndo_siocdevprivate = ptm_ioctl,
.ndo_tx_timeout = ptm_tx_timeout,
};
@ -370,62 +370,62 @@ PTM_HARD_START_XMIT_FAIL:
return 0;
}
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, void __user *data, int cmd)
{
ASSERT(dev == g_net_dev[0], "incorrect device");
switch ( cmd )
{
case IFX_PTM_MIB_CW_GET:
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
((PTM_CW_IF_ENTRY_T *)ifr->ifr_data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxNoIdleCodewords = IFX_REG_R32(DREG_AR_CELL0) + IFX_REG_R32(DREG_AR_CELL1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxIdleCodewords = IFX_REG_R32(DREG_AR_IDLE_CNT0) + IFX_REG_R32(DREG_AR_IDLE_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifRxCodingViolation = IFX_REG_R32(DREG_AR_CVN_CNT0) + IFX_REG_R32(DREG_AR_CVN_CNT1) + IFX_REG_R32(DREG_AR_CVNP_CNT0) + IFX_REG_R32(DREG_AR_CVNP_CNT1);
((PTM_CW_IF_ENTRY_T *)data)->ifTxNoIdleCodewords = IFX_REG_R32(DREG_AT_CELL0) + IFX_REG_R32(DREG_AT_CELL1);
((PTM_CW_IF_ENTRY_T *)data)->ifTxIdleCodewords = IFX_REG_R32(DREG_AT_IDLE_CNT0) + IFX_REG_R32(DREG_AT_IDLE_CNT1);
break;
case IFX_PTM_MIB_FRAME_GET:
{
PTM_FRAME_MIB_T data = {0};
PTM_FRAME_MIB_T tmp = {0};
int i;
data.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1);
tmp.RxCorrect = IFX_REG_R32(DREG_AR_HEC_CNT0) + IFX_REG_R32(DREG_AR_HEC_CNT1) + IFX_REG_R32(DREG_AR_AIIDLE_CNT0) + IFX_REG_R32(DREG_AR_AIIDLE_CNT1);
for ( i = 0; i < 4; i++ )
data.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu;
tmp.RxDropped += WAN_RX_MIB_TABLE(i)->wrx_dropdes_pdu;
for ( i = 0; i < 8; i++ )
data.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu;
tmp.TxSend += WAN_TX_MIB_TABLE(i)->wtx_total_pdu;
*((PTM_FRAME_MIB_T *)ifr->ifr_data) = data;
*((PTM_FRAME_MIB_T *)data) = tmp;
}
break;
case IFX_PTM_CFG_GET:
// use bear channel 0 preemption gamma interface settings
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcPresent = 1;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;;
((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)data)->RxEthCrcPresent = 1;
((IFX_PTM_CFG_T *)data)->RxEthCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_eth_fcs_ver_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)data)->RxTcCrcCheck = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis == 0 ? 1 : 0;;
((IFX_PTM_CFG_T *)data)->RxTcCrcLen = RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size == 0 ? 0 : (RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size * 16);
((IFX_PTM_CFG_T *)data)->TxEthCrcGen = TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis == 0 ? 1 : 0;
((IFX_PTM_CFG_T *)data)->TxTcCrcGen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : 1;
((IFX_PTM_CFG_T *)data)->TxTcCrcLen = TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size == 0 ? 0 : (TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size * 16);
break;
case IFX_PTM_CFG_SET:
{
int i;
for ( i = 0; i < 4; i++ ) {
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxEthCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(i)->rx_eth_fcs_ver_dis = ((IFX_PTM_CFG_T *)data)->RxEthCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcCheck ? 0 : 1;
RX_GAMMA_ITF_CFG(0)->rx_tc_crc_ver_dis = ((IFX_PTM_CFG_T *)data)->RxTcCrcCheck ? 0 : 1;
switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->RxTcCrcLen ) {
switch ( ((IFX_PTM_CFG_T *)data)->RxTcCrcLen ) {
case 16: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 1; break;
case 32: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 2; break;
default: RX_GAMMA_ITF_CFG(0)->rx_tc_crc_size = 0;
}
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxEthCrcGen ? 0 : 1;
TX_GAMMA_ITF_CFG(0)->tx_eth_fcs_gen_dis = ((IFX_PTM_CFG_T *)data)->TxEthCrcGen ? 0 : 1;
if ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcGen ) {
switch ( ((IFX_PTM_CFG_T *)ifr->ifr_data)->TxTcCrcLen ) {
if ( ((IFX_PTM_CFG_T *)data)->TxTcCrcGen ) {
switch ( ((IFX_PTM_CFG_T *)data)->TxTcCrcLen ) {
case 16: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 1; break;
case 32: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 2; break;
default: TX_GAMMA_ITF_CFG(0)->tx_tc_crc_size = 0;
@ -440,7 +440,7 @@ static int ptm_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ppe_prio_q_map cmd;
if ( copy_from_user(&cmd, ifr->ifr_data, sizeof(cmd)) )
if ( copy_from_user(&cmd, data, sizeof(cmd)) )
return -EFAULT;
if ( cmd.pkt_prio < 0 || cmd.pkt_prio >= ARRAY_SIZE(g_ptm_prio_queue_map) )

View File

@ -0,0 +1,69 @@
From 1b7c710a8e912d54a24742ed5a87a047be64141a Mon Sep 17 00:00:00 2001
From: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Date: Tue, 7 Feb 2023 17:11:46 +0530
Subject: [PATCH 350/351] wifi: mac80211: Allow NSS change only up to
capability
Stations can update bandwidth/NSS change in
VHT action frame with action type Operating Mode Notification.
(IEEE Std 802.11-2020 - 9.4.1.53 Operating Mode field)
For Operating Mode Notification, an RX NSS change to a value
greater than AP's maximum NSS should not be allowed.
During fuzz testing, by forcefully sending VHT Op. mode notif.
frames from STA with random rx_nss values, it is found that AP
accepts rx_nss values greater that APs maximum NSS instead of
discarding such NSS change.
Hence allow NSS change only up to maximum NSS that is negotiated
and capped to AP's capability during association.
Signed-off-by: Rameshkumar Sundaram <quic_ramess@quicinc.com>
Link: https://lore.kernel.org/r/20230207114146.10567-1-quic_ramess@quicinc.com
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit 57b341e9ab13e5688491bfd54f8b5502416c8905)
---
net/mac80211/vht.c | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -637,7 +637,7 @@ u32 __ieee80211_vht_handle_opmode(struct
enum ieee80211_sta_rx_bandwidth new_bw;
struct sta_opmode_info sta_opmode = {};
u32 changed = 0;
- u8 nss;
+ u8 nss, cur_nss;
/* ignore - no support for BF yet */
if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF)
@@ -648,10 +648,25 @@ u32 __ieee80211_vht_handle_opmode(struct
nss += 1;
if (link_sta->pub->rx_nss != nss) {
- link_sta->pub->rx_nss = nss;
- sta_opmode.rx_nss = nss;
- changed |= IEEE80211_RC_NSS_CHANGED;
- sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ cur_nss = link_sta->pub->rx_nss;
+ /* Reset rx_nss and call ieee80211_sta_set_rx_nss() which
+ * will set the same to max nss value calculated based on capability.
+ */
+ link_sta->pub->rx_nss = 0;
+ ieee80211_sta_set_rx_nss(link_sta);
+ /* Do not allow an nss change to rx_nss greater than max_nss
+ * negotiated and capped to APs capability during association.
+ */
+ if (nss <= link_sta->pub->rx_nss) {
+ link_sta->pub->rx_nss = nss;
+ sta_opmode.rx_nss = nss;
+ changed |= IEEE80211_RC_NSS_CHANGED;
+ sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ } else {
+ link_sta->pub->rx_nss = cur_nss;
+ pr_warn_ratelimited("Ignoring NSS change in VHT Operating Mode Notification from %pM with invalid nss %d",
+ link_sta->pub->addr, nss);
+ }
}
switch (opmode & IEEE80211_OPMODE_NOTIF_CHANWIDTH_MASK) {

View File

@ -0,0 +1,186 @@
From 32d043fc10f1814e421c0ff90c0ee6b303f2821c Mon Sep 17 00:00:00 2001
From: Johannes Berg <johannes.berg@intel.com>
Date: Wed, 28 Feb 2024 12:01:57 +0100
Subject: [PATCH 351/351] wifi: mac80211: track capability/opmode NSS
separately
We're currently tracking rx_nss for each station, and that
is meant to be initialized to the capability NSS and later
reduced by the operating mode notification NSS.
However, we're mixing up capabilities and operating mode
NSS in the same variable. This forces us to recalculate
the NSS capability on operating mode notification RX,
which is a bit strange; due to the previous fix I had to
never keep rx_nss as zero, it also means that the capa is
never taken into account properly.
Fix all this by storing the capability value, that can be
recalculated unconditionally whenever needed, and storing
the operating mode notification NSS separately, taking it
into account when assigning the final rx_nss value.
Cc: stable@vger.kernel.org
Fixes: dd6c064cfc3f ("wifi: mac80211: set station RX-NSS on reconfig")
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://msgid.link/20240228120157.0e1c41924d1d.I0acaa234e0267227b7e3ef81a59117c8792116bc@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
(cherry picked from commit a8bca3e9371dc5e276af4168be099b2a05554c2a)
---
net/mac80211/cfg.c | 2 +-
net/mac80211/ieee80211_i.h | 2 +-
net/mac80211/rate.c | 2 +-
net/mac80211/sta_info.h | 6 ++++-
net/mac80211/vht.c | 46 ++++++++++++++++++--------------------
5 files changed, 30 insertions(+), 28 deletions(-)
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1836,7 +1836,7 @@ static int sta_link_apply_parameters(str
sband->band);
}
- ieee80211_sta_set_rx_nss(link_sta);
+ ieee80211_sta_init_nss(link_sta);
return ret;
}
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -2101,7 +2101,7 @@ enum ieee80211_sta_rx_bandwidth
ieee80211_sta_cap_rx_bw(struct link_sta_info *link_sta);
enum ieee80211_sta_rx_bandwidth
ieee80211_sta_cur_vht_bw(struct link_sta_info *link_sta);
-void ieee80211_sta_set_rx_nss(struct link_sta_info *link_sta);
+void ieee80211_sta_init_nss(struct link_sta_info *link_sta);
enum ieee80211_sta_rx_bandwidth
ieee80211_chan_width_to_rx_bw(enum nl80211_chan_width width);
enum nl80211_chan_width
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -37,7 +37,7 @@ void rate_control_rate_init(struct sta_i
struct ieee80211_supported_band *sband;
struct ieee80211_chanctx_conf *chanctx_conf;
- ieee80211_sta_set_rx_nss(&sta->deflink);
+ ieee80211_sta_init_nss(&sta->deflink);
if (!ref)
return;
--- a/net/mac80211/sta_info.h
+++ b/net/mac80211/sta_info.h
@@ -3,7 +3,7 @@
* Copyright 2002-2005, Devicescape Software, Inc.
* Copyright 2013-2014 Intel Mobile Communications GmbH
* Copyright(c) 2015-2017 Intel Deutschland GmbH
- * Copyright(c) 2020-2022 Intel Corporation
+ * Copyright(c) 2020-2024 Intel Corporation
*/
#ifndef STA_INFO_H
@@ -485,6 +485,8 @@ struct ieee80211_fragment_cache {
* same for non-MLD STA. This is used as key for searching link STA
* @link_id: Link ID uniquely identifying the link STA. This is 0 for non-MLD
* and set to the corresponding vif LinkId for MLD STA
+ * @op_mode_nss: NSS limit as set by operating mode notification, or 0
+ * @capa_nss: NSS limit as determined by local and peer capabilities
* @link_hash_node: hash node for rhashtable
* @sta: Points to the STA info
* @gtk: group keys negotiated with this station, if any
@@ -520,6 +522,8 @@ struct link_sta_info {
u8 addr[ETH_ALEN];
u8 link_id;
+ u8 op_mode_nss, capa_nss;
+
struct rhlist_head link_hash_node;
struct sta_info *sta;
--- a/net/mac80211/vht.c
+++ b/net/mac80211/vht.c
@@ -4,7 +4,7 @@
*
* Portions of this file
* Copyright(c) 2015 - 2016 Intel Deutschland GmbH
- * Copyright (C) 2018 - 2023 Intel Corporation
+ * Copyright (C) 2018 - 2024 Intel Corporation
*/
#include <linux/ieee80211.h>
@@ -541,15 +541,11 @@ ieee80211_sta_cur_vht_bw(struct link_sta
return bw;
}
-void ieee80211_sta_set_rx_nss(struct link_sta_info *link_sta)
+void ieee80211_sta_init_nss(struct link_sta_info *link_sta)
{
u8 ht_rx_nss = 0, vht_rx_nss = 0, he_rx_nss = 0, eht_rx_nss = 0, rx_nss;
bool support_160;
- /* if we received a notification already don't overwrite it */
- if (link_sta->pub->rx_nss)
- return;
-
if (link_sta->pub->eht_cap.has_eht) {
int i;
const u8 *rx_nss_mcs = (void *)&link_sta->pub->eht_cap.eht_mcs_nss_supp;
@@ -627,7 +623,15 @@ void ieee80211_sta_set_rx_nss(struct lin
rx_nss = max(vht_rx_nss, ht_rx_nss);
rx_nss = max(he_rx_nss, rx_nss);
rx_nss = max(eht_rx_nss, rx_nss);
- link_sta->pub->rx_nss = max_t(u8, 1, rx_nss);
+ rx_nss = max_t(u8, 1, rx_nss);
+ link_sta->capa_nss = rx_nss;
+
+ /* that shouldn't be set yet, but we can handle it anyway */
+ if (link_sta->op_mode_nss)
+ link_sta->pub->rx_nss =
+ min_t(u8, rx_nss, link_sta->op_mode_nss);
+ else
+ link_sta->pub->rx_nss = rx_nss;
}
u32 __ieee80211_vht_handle_opmode(struct ieee80211_sub_if_data *sdata,
@@ -637,7 +641,7 @@ u32 __ieee80211_vht_handle_opmode(struct
enum ieee80211_sta_rx_bandwidth new_bw;
struct sta_opmode_info sta_opmode = {};
u32 changed = 0;
- u8 nss, cur_nss;
+ u8 nss;
/* ignore - no support for BF yet */
if (opmode & IEEE80211_OPMODE_NOTIF_RX_NSS_TYPE_BF)
@@ -647,23 +651,17 @@ u32 __ieee80211_vht_handle_opmode(struct
nss >>= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
nss += 1;
- if (link_sta->pub->rx_nss != nss) {
- cur_nss = link_sta->pub->rx_nss;
- /* Reset rx_nss and call ieee80211_sta_set_rx_nss() which
- * will set the same to max nss value calculated based on capability.
- */
- link_sta->pub->rx_nss = 0;
- ieee80211_sta_set_rx_nss(link_sta);
- /* Do not allow an nss change to rx_nss greater than max_nss
- * negotiated and capped to APs capability during association.
- */
- if (nss <= link_sta->pub->rx_nss) {
- link_sta->pub->rx_nss = nss;
- sta_opmode.rx_nss = nss;
- changed |= IEEE80211_RC_NSS_CHANGED;
- sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ if (link_sta->op_mode_nss != nss) {
+ if (nss <= link_sta->capa_nss) {
+ link_sta->op_mode_nss = nss;
+
+ if (nss != link_sta->pub->rx_nss) {
+ link_sta->pub->rx_nss = nss;
+ changed |= IEEE80211_RC_NSS_CHANGED;
+ sta_opmode.rx_nss = link_sta->pub->rx_nss;
+ sta_opmode.changed |= STA_OPMODE_N_SS_CHANGED;
+ }
} else {
- link_sta->pub->rx_nss = cur_nss;
pr_warn_ratelimited("Ignoring NSS change in VHT Operating Mode Notification from %pM with invalid nss %d",
link_sta->pub->addr, nss);
}

View File

@ -191,7 +191,7 @@
+ .ndo_stop = ar231x_close,
+ .ndo_start_xmit = ar231x_start_xmit,
+ .ndo_set_rx_mode = ar231x_multicast_list,
+ .ndo_do_ioctl = ar231x_ioctl,
+ .ndo_eth_ioctl = ar231x_ioctl,
+ .ndo_validate_addr = eth_validate_addr,
+ .ndo_set_mac_address = eth_mac_addr,
+ .ndo_tx_timeout = ar231x_tx_timeout,

View File

@ -1162,33 +1162,10 @@ static int ag71xx_do_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
struct ag71xx *ag = netdev_priv(dev);
if (ag->phy_dev == NULL)
return -ENODEV;
switch (cmd) {
case SIOCSIFHWADDR:
if (copy_from_user
(dev->dev_addr, ifr->ifr_data, sizeof(dev->dev_addr)))
return -EFAULT;
return 0;
case SIOCGIFHWADDR:
if (copy_to_user
(ifr->ifr_data, dev->dev_addr, sizeof(dev->dev_addr)))
return -EFAULT;
return 0;
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:
if (ag->phy_dev == NULL)
break;
return phy_mii_ioctl(ag->phy_dev, ifr, cmd);
default:
break;
}
return -EOPNOTSUPP;
return phy_mii_ioctl(ag->phy_dev, ifr, cmd);
}
static void ag71xx_oom_timer_handler(struct timer_list *t)
@ -1502,7 +1479,7 @@ static const struct net_device_ops ag71xx_netdev_ops = {
.ndo_open = ag71xx_open,
.ndo_stop = ag71xx_stop,
.ndo_start_xmit = ag71xx_hard_start_xmit,
.ndo_do_ioctl = ag71xx_do_ioctl,
.ndo_eth_ioctl = ag71xx_do_ioctl,
.ndo_tx_timeout = ag71xx_tx_timeout,
.ndo_change_mtu = ag71xx_change_mtu,
.ndo_set_mac_address = eth_mac_addr,

View File

@ -751,7 +751,7 @@ SVN-Revision: 35130
EXPORT_SYMBOL(xfrm_parse_spi);
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4192,14 +4192,16 @@ static bool tcp_parse_aligned_timestamp(
@@ -4201,14 +4201,16 @@ static bool tcp_parse_aligned_timestamp(
{
const __be32 *ptr = (const __be32 *)(th + 1);

View File

@ -29,7 +29,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
--- a/drivers/gpio/gpiolib-of.c
+++ b/drivers/gpio/gpiolib-of.c
@@ -646,23 +646,30 @@ static struct gpio_desc *of_parse_own_gp
@@ -698,23 +698,30 @@ static struct gpio_desc *of_parse_own_gp
* of_gpiochip_add_hog - Add all hogs in a hog device node
* @chip: gpio chip to act on
* @hog: device node describing the hogs
@ -62,7 +62,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
ret = gpiod_hog(desc, name, lflags, dflags);
if (ret < 0)
return ret;
@@ -678,12 +685,15 @@ static int of_gpiochip_add_hog(struct gp
@@ -730,12 +737,15 @@ static int of_gpiochip_add_hog(struct gp
/**
* of_gpiochip_scan_gpios - Scan gpio-controller for gpio definitions
* @chip: gpio chip to act on
@ -81,7 +81,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
{
struct device_node *np;
int ret;
@@ -692,7 +702,7 @@ static int of_gpiochip_scan_gpios(struct
@@ -744,7 +754,7 @@ static int of_gpiochip_scan_gpios(struct
if (!of_property_read_bool(np, "gpio-hog"))
continue;
@ -90,7 +90,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
if (ret < 0) {
of_node_put(np);
return ret;
@@ -758,7 +768,7 @@ static int of_gpio_notify(struct notifie
@@ -810,7 +820,7 @@ static int of_gpio_notify(struct notifie
if (chip == NULL)
return NOTIFY_OK; /* not for us */
@ -99,7 +99,7 @@ Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
if (ret < 0) {
pr_err("%s: failed to add hogs for %pOF\n", __func__,
rd->dn);
@@ -1037,9 +1047,11 @@ int of_gpiochip_add(struct gpio_chip *ch
@@ -1089,9 +1099,11 @@ int of_gpiochip_add(struct gpio_chip *ch
of_node_get(chip->of_node);

View File

@ -372,7 +372,7 @@ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
#ifdef __KERNEL__
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -469,6 +469,7 @@ assign_new_owner:
@@ -471,6 +471,7 @@ assign_new_owner:
goto retry;
}
WRITE_ONCE(mm->owner, c);

View File

@ -97,7 +97,7 @@ Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl
return ret;
--- a/drivers/mtd/nand/raw/nand_base.c
+++ b/drivers/mtd/nand/raw/nand_base.c
@@ -3815,6 +3815,7 @@ static int nand_read_oob(struct mtd_info
@@ -3822,6 +3822,7 @@ static int nand_read_oob(struct mtd_info
struct mtd_oob_ops *ops)
{
struct nand_chip *chip = mtd_to_nand(mtd);
@ -105,7 +105,7 @@ Link: https://lore.kernel.org/linux-mtd/20220629125737.14418-4-kernel@kempniu.pl
int ret;
ops->retlen = 0;
@@ -3826,11 +3827,20 @@ static int nand_read_oob(struct mtd_info
@@ -3833,11 +3834,20 @@ static int nand_read_oob(struct mtd_info
nand_get_device(chip);

View File

@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static DEFINE_MUTEX(nvmem_mutex);
static DEFINE_IDA(nvmem_ida);
@@ -424,7 +428,7 @@ static struct bus_type nvmem_bus_type =
@@ -423,7 +427,7 @@ static struct bus_type nvmem_bus_type =
.name = "nvmem",
};
@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
blocking_notifier_call_chain(&nvmem_notifier, NVMEM_CELL_REMOVE, cell);
mutex_lock(&nvmem_mutex);
@@ -437,13 +441,13 @@ static void nvmem_cell_drop(struct nvmem
@@ -436,13 +440,13 @@ static void nvmem_cell_drop(struct nvmem
static void nvmem_device_remove_all_cells(const struct nvmem_device *nvmem)
{
@ -82,7 +82,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
mutex_lock(&nvmem_mutex);
list_add_tail(&cell->node, &cell->nvmem->cells);
@@ -451,9 +455,9 @@ static void nvmem_cell_add(struct nvmem_
@@ -450,9 +454,9 @@ static void nvmem_cell_add(struct nvmem_
blocking_notifier_call_chain(&nvmem_notifier, NVMEM_CELL_ADD, cell);
}
@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
cell->nvmem = nvmem;
cell->offset = info->offset;
@@ -477,13 +481,13 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -476,13 +480,13 @@ static int nvmem_cell_info_to_nvmem_cell
return 0;
}
@ -113,7 +113,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (err)
return err;
@@ -507,7 +511,7 @@ static int nvmem_add_cells(struct nvmem_
@@ -506,7 +510,7 @@ static int nvmem_add_cells(struct nvmem_
const struct nvmem_cell_info *info,
int ncells)
{
@ -122,7 +122,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int i, rval;
cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
@@ -521,13 +525,13 @@ static int nvmem_add_cells(struct nvmem_
@@ -520,13 +524,13 @@ static int nvmem_add_cells(struct nvmem_
goto err;
}
@ -138,7 +138,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
/* remove tmp array */
@@ -536,7 +540,7 @@ static int nvmem_add_cells(struct nvmem_
@@ -535,7 +539,7 @@ static int nvmem_add_cells(struct nvmem_
return 0;
err:
while (i--)
@ -147,7 +147,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
kfree(cells);
@@ -573,7 +577,7 @@ static int nvmem_add_cells_from_table(st
@@ -572,7 +576,7 @@ static int nvmem_add_cells_from_table(st
{
const struct nvmem_cell_info *info;
struct nvmem_cell_table *table;
@ -156,7 +156,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int rval = 0, i;
mutex_lock(&nvmem_cell_mutex);
@@ -588,15 +592,13 @@ static int nvmem_add_cells_from_table(st
@@ -587,15 +591,13 @@ static int nvmem_add_cells_from_table(st
goto out;
}
@ -174,7 +174,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
}
}
@@ -606,10 +608,10 @@ out:
@@ -605,10 +607,10 @@ out:
return rval;
}
@ -188,7 +188,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mutex_lock(&nvmem_mutex);
list_for_each_entry(iter, &nvmem->cells, node) {
@@ -680,7 +682,7 @@ static int nvmem_add_cells_from_of(struc
@@ -679,7 +681,7 @@ static int nvmem_add_cells_from_of(struc
{
struct device_node *parent, *child;
struct device *dev = &nvmem->dev;
@ -197,7 +197,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
const __be32 *addr;
int len;
@@ -729,7 +731,7 @@ static int nvmem_add_cells_from_of(struc
@@ -728,7 +730,7 @@ static int nvmem_add_cells_from_of(struc
}
cell->np = of_node_get(child);
@ -206,7 +206,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
return 0;
@@ -1142,9 +1144,33 @@ struct nvmem_device *devm_nvmem_device_g
@@ -1141,9 +1143,33 @@ struct nvmem_device *devm_nvmem_device_g
}
EXPORT_SYMBOL_GPL(devm_nvmem_device_get);
@ -240,7 +240,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct nvmem_cell *cell = ERR_PTR(-ENOENT);
struct nvmem_cell_lookup *lookup;
struct nvmem_device *nvmem;
@@ -1169,11 +1195,15 @@ nvmem_cell_get_from_lookup(struct device
@@ -1168,11 +1194,15 @@ nvmem_cell_get_from_lookup(struct device
break;
}
@ -259,7 +259,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
break;
}
@@ -1184,10 +1214,10 @@ nvmem_cell_get_from_lookup(struct device
@@ -1183,10 +1213,10 @@ nvmem_cell_get_from_lookup(struct device
}
#if IS_ENABLED(CONFIG_OF)
@ -273,7 +273,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mutex_lock(&nvmem_mutex);
list_for_each_entry(iter, &nvmem->cells, node) {
@@ -1217,6 +1247,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1216,6 +1246,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
{
struct device_node *cell_np, *nvmem_np;
struct nvmem_device *nvmem;
@ -281,7 +281,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct nvmem_cell *cell;
int index = 0;
@@ -1237,12 +1268,16 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1236,12 +1267,16 @@ struct nvmem_cell *of_nvmem_cell_get(str
if (IS_ERR(nvmem))
return ERR_CAST(nvmem);
@ -300,7 +300,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return cell;
}
EXPORT_SYMBOL_GPL(of_nvmem_cell_get);
@@ -1348,13 +1383,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put);
@@ -1347,13 +1382,17 @@ EXPORT_SYMBOL(devm_nvmem_cell_put);
*/
void nvmem_cell_put(struct nvmem_cell *cell)
{
@ -320,7 +320,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
u8 *p, *b;
int i, extra, bit_offset = cell->bit_offset;
@@ -1388,8 +1427,8 @@ static void nvmem_shift_read_buffer_in_p
@@ -1387,8 +1426,8 @@ static void nvmem_shift_read_buffer_in_p
}
static int __nvmem_cell_read(struct nvmem_device *nvmem,
@ -331,7 +331,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
int rc;
@@ -1420,18 +1459,18 @@ static int __nvmem_cell_read(struct nvme
@@ -1419,18 +1458,18 @@ static int __nvmem_cell_read(struct nvme
*/
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
{
@ -353,7 +353,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rc) {
kfree(buf);
return ERR_PTR(rc);
@@ -1441,7 +1480,7 @@ void *nvmem_cell_read(struct nvmem_cell
@@ -1440,7 +1479,7 @@ void *nvmem_cell_read(struct nvmem_cell
}
EXPORT_SYMBOL_GPL(nvmem_cell_read);
@ -362,7 +362,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
u8 *_buf, int len)
{
struct nvmem_device *nvmem = cell->nvmem;
@@ -1494,16 +1533,7 @@ err:
@@ -1493,16 +1532,7 @@ err:
return ERR_PTR(rc);
}
@ -380,7 +380,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
struct nvmem_device *nvmem = cell->nvmem;
int rc;
@@ -1529,6 +1559,21 @@ int nvmem_cell_write(struct nvmem_cell *
@@ -1528,6 +1558,21 @@ int nvmem_cell_write(struct nvmem_cell *
return len;
}
@ -402,7 +402,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
EXPORT_SYMBOL_GPL(nvmem_cell_write);
static int nvmem_cell_read_common(struct device *dev, const char *cell_id,
@@ -1631,7 +1676,7 @@ static const void *nvmem_cell_read_varia
@@ -1630,7 +1675,7 @@ static const void *nvmem_cell_read_varia
if (IS_ERR(cell))
return cell;
@ -411,7 +411,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
buf = nvmem_cell_read(cell, len);
nvmem_cell_put(cell);
if (IS_ERR(buf))
@@ -1727,18 +1772,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab
@@ -1726,18 +1771,18 @@ EXPORT_SYMBOL_GPL(nvmem_cell_read_variab
ssize_t nvmem_device_cell_read(struct nvmem_device *nvmem,
struct nvmem_cell_info *info, void *buf)
{
@ -433,7 +433,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rc)
return rc;
@@ -1758,17 +1803,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read
@@ -1757,17 +1802,17 @@ EXPORT_SYMBOL_GPL(nvmem_device_cell_read
int nvmem_device_cell_write(struct nvmem_device *nvmem,
struct nvmem_cell_info *info, void *buf)
{

View File

@ -30,7 +30,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct gpio_desc *wp_gpio;
void *priv;
};
@@ -799,6 +800,7 @@ struct nvmem_device *nvmem_register(cons
@@ -798,6 +799,7 @@ struct nvmem_device *nvmem_register(cons
nvmem->type = config->type;
nvmem->reg_read = config->reg_read;
nvmem->reg_write = config->reg_write;
@ -38,7 +38,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nvmem->keepout = config->keepout;
nvmem->nkeepout = config->nkeepout;
if (config->of_node)
@@ -1441,6 +1443,13 @@ static int __nvmem_cell_read(struct nvme
@@ -1440,6 +1442,13 @@ static int __nvmem_cell_read(struct nvme
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);

View File

@ -17,7 +17,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -943,28 +943,6 @@ struct nvmem_device *devm_nvmem_register
@@ -942,28 +942,6 @@ struct nvmem_device *devm_nvmem_register
}
EXPORT_SYMBOL_GPL(devm_nvmem_register);

View File

@ -16,7 +16,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -905,9 +905,9 @@ void nvmem_unregister(struct nvmem_devic
@@ -904,9 +904,9 @@ void nvmem_unregister(struct nvmem_devic
}
EXPORT_SYMBOL_GPL(nvmem_unregister);
@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
}
/**
@@ -924,20 +924,16 @@ static void devm_nvmem_release(struct de
@@ -923,20 +923,16 @@ static void devm_nvmem_release(struct de
struct nvmem_device *devm_nvmem_register(struct device *dev,
const struct nvmem_config *config)
{

View File

@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -901,7 +901,8 @@ static void nvmem_device_release(struct
@@ -900,7 +900,8 @@ static void nvmem_device_release(struct
*/
void nvmem_unregister(struct nvmem_device *nvmem)
{

View File

@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -467,6 +467,7 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -466,6 +466,7 @@ static int nvmem_cell_info_to_nvmem_cell
cell->bit_offset = info->bit_offset;
cell->nbits = info->nbits;

View File

@ -21,7 +21,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -1237,16 +1237,21 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1236,16 +1236,21 @@ struct nvmem_cell *of_nvmem_cell_get(str
if (!cell_np)
return ERR_PTR(-ENOENT);

View File

@ -15,7 +15,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -764,7 +764,7 @@ struct nvmem_device *nvmem_register(cons
@@ -763,7 +763,7 @@ struct nvmem_device *nvmem_register(cons
if (!nvmem)
return ERR_PTR(-ENOMEM);

View File

@ -47,7 +47,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
};
static DEFINE_MUTEX(nvmem_mutex);
@@ -1122,7 +1123,8 @@ struct nvmem_device *devm_nvmem_device_g
@@ -1121,7 +1122,8 @@ struct nvmem_device *devm_nvmem_device_g
}
EXPORT_SYMBOL_GPL(devm_nvmem_device_get);
@ -57,7 +57,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
struct nvmem_cell *cell;
const char *name = NULL;
@@ -1141,6 +1143,7 @@ static struct nvmem_cell *nvmem_create_c
@@ -1140,6 +1142,7 @@ static struct nvmem_cell *nvmem_create_c
cell->id = name;
cell->entry = entry;
@ -65,7 +65,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
return cell;
}
@@ -1179,7 +1182,7 @@ nvmem_cell_get_from_lookup(struct device
@@ -1178,7 +1181,7 @@ nvmem_cell_get_from_lookup(struct device
__nvmem_device_put(nvmem);
cell = ERR_PTR(-ENOENT);
} else {
@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (IS_ERR(cell))
__nvmem_device_put(nvmem);
}
@@ -1227,15 +1230,27 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1226,15 +1229,27 @@ struct nvmem_cell *of_nvmem_cell_get(str
struct nvmem_device *nvmem;
struct nvmem_cell_entry *cell_entry;
struct nvmem_cell *cell;
@ -105,7 +105,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nvmem_np = of_get_parent(cell_np);
if (!nvmem_np) {
@@ -1257,7 +1272,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1256,7 +1271,7 @@ struct nvmem_cell *of_nvmem_cell_get(str
return ERR_PTR(-ENOENT);
}
@ -114,7 +114,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (IS_ERR(cell))
__nvmem_device_put(nvmem);
@@ -1410,8 +1425,8 @@ static void nvmem_shift_read_buffer_in_p
@@ -1409,8 +1424,8 @@ static void nvmem_shift_read_buffer_in_p
}
static int __nvmem_cell_read(struct nvmem_device *nvmem,
@ -125,7 +125,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
int rc;
@@ -1425,7 +1440,7 @@ static int __nvmem_cell_read(struct nvme
@@ -1424,7 +1439,7 @@ static int __nvmem_cell_read(struct nvme
nvmem_shift_read_buffer_in_place(cell, buf);
if (nvmem->cell_post_process) {
@ -134,7 +134,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cell->offset, buf, cell->bytes);
if (rc)
return rc;
@@ -1460,7 +1475,7 @@ void *nvmem_cell_read(struct nvmem_cell
@@ -1459,7 +1474,7 @@ void *nvmem_cell_read(struct nvmem_cell
if (!buf)
return ERR_PTR(-ENOMEM);
@ -143,7 +143,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rc) {
kfree(buf);
return ERR_PTR(rc);
@@ -1773,7 +1788,7 @@ ssize_t nvmem_device_cell_read(struct nv
@@ -1772,7 +1787,7 @@ ssize_t nvmem_device_cell_read(struct nv
if (rc)
return rc;

View File

@ -22,7 +22,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -515,7 +515,7 @@ static int nvmem_add_cells(struct nvmem_
@@ -514,7 +514,7 @@ static int nvmem_add_cells(struct nvmem_
int ncells)
{
struct nvmem_cell_entry **cells;
@ -31,7 +31,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cells = kcalloc(ncells, sizeof(*cells), GFP_KERNEL);
if (!cells)
@@ -525,28 +525,22 @@ static int nvmem_add_cells(struct nvmem_
@@ -524,28 +524,22 @@ static int nvmem_add_cells(struct nvmem_
cells[i] = kzalloc(sizeof(**cells), GFP_KERNEL);
if (!cells[i]) {
rval = -ENOMEM;

View File

@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -502,6 +502,36 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -501,6 +501,36 @@ static int nvmem_cell_info_to_nvmem_cell
}
/**
@ -56,7 +56,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* nvmem_add_cells() - Add cell information to an nvmem device
*
* @nvmem: nvmem device to add cells to.
@@ -514,34 +544,15 @@ static int nvmem_add_cells(struct nvmem_
@@ -513,34 +543,15 @@ static int nvmem_add_cells(struct nvmem_
const struct nvmem_cell_info *info,
int ncells)
{

View File

@ -19,7 +19,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -688,15 +688,14 @@ static int nvmem_validate_keepouts(struc
@@ -687,15 +687,14 @@ static int nvmem_validate_keepouts(struc
static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
{
@ -39,7 +39,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
addr = of_get_property(child, "reg", &len);
if (!addr)
continue;
@@ -706,40 +705,24 @@ static int nvmem_add_cells_from_of(struc
@@ -705,40 +704,24 @@ static int nvmem_add_cells_from_of(struc
return -EINVAL;
}

View File

@ -103,7 +103,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
static int __nvmem_reg_read(struct nvmem_device *nvmem, unsigned int offset,
void *val, size_t bytes)
{
@@ -728,6 +732,101 @@ static int nvmem_add_cells_from_of(struc
@@ -727,6 +731,101 @@ static int nvmem_add_cells_from_of(struc
return 0;
}
@ -205,7 +205,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
/**
* nvmem_register() - Register a nvmem device for given nvmem_config.
* Also creates a binary entry in /sys/bus/nvmem/devices/dev-name/nvmem
@@ -834,6 +933,12 @@ struct nvmem_device *nvmem_register(cons
@@ -833,6 +932,12 @@ struct nvmem_device *nvmem_register(cons
goto err_put_device;
}
@ -218,7 +218,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (config->cells) {
rval = nvmem_add_cells(nvmem, config->cells, config->ncells);
if (rval)
@@ -854,12 +959,17 @@ struct nvmem_device *nvmem_register(cons
@@ -853,12 +958,17 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;
@ -236,7 +236,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (config->compat)
nvmem_sysfs_remove_compat(nvmem, config);
err_put_device:
@@ -881,6 +991,7 @@ static void nvmem_device_release(struct
@@ -880,6 +990,7 @@ static void nvmem_device_release(struct
device_remove_bin_file(nvmem->base_dev, &nvmem->eeprom);
nvmem_device_remove_all_cells(nvmem);
@ -244,7 +244,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
device_unregister(&nvmem->dev);
}
@@ -1246,6 +1357,15 @@ struct nvmem_cell *of_nvmem_cell_get(str
@@ -1245,6 +1356,15 @@ struct nvmem_cell *of_nvmem_cell_get(str
return ERR_PTR(-EINVAL);
}

View File

@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -755,7 +755,7 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste
@@ -754,7 +754,7 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste
static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem)
{
struct device_node *layout_np, *np = nvmem->dev.of_node;
@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
layout_np = of_get_child_by_name(np, "nvmem-layout");
if (!layout_np)
@@ -938,6 +938,13 @@ struct nvmem_device *nvmem_register(cons
@@ -937,6 +937,13 @@ struct nvmem_device *nvmem_register(cons
* pointer will be NULL and nvmem_layout_put() will be a noop.
*/
nvmem->layout = config->layout ?: nvmem_layout_get(nvmem);
@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (config->cells) {
rval = nvmem_add_cells(nvmem, config->cells, config->ncells);
@@ -970,6 +977,7 @@ struct nvmem_device *nvmem_register(cons
@@ -969,6 +976,7 @@ struct nvmem_device *nvmem_register(cons
err_remove_cells:
nvmem_device_remove_all_cells(nvmem);
nvmem_layout_put(nvmem->layout);

View File

@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#include <linux/slab.h>
struct nvmem_device {
@@ -761,6 +762,13 @@ static struct nvmem_layout *nvmem_layout
@@ -760,6 +761,13 @@ static struct nvmem_layout *nvmem_layout
if (!layout_np)
return NULL;

View File

@ -28,7 +28,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct device_node *np;
struct nvmem_device *nvmem;
struct list_head node;
@@ -470,6 +471,7 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -469,6 +470,7 @@ static int nvmem_cell_info_to_nvmem_cell
cell->offset = info->offset;
cell->bytes = info->bytes;
cell->name = info->name;
@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cell->bit_offset = info->bit_offset;
cell->nbits = info->nbits;
@@ -1563,6 +1565,13 @@ static int __nvmem_cell_read(struct nvme
@@ -1562,6 +1564,13 @@ static int __nvmem_cell_read(struct nvme
if (cell->bit_offset || cell->nbits)
nvmem_shift_read_buffer_in_place(cell, buf);
@ -50,7 +50,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (nvmem->cell_post_process) {
rc = nvmem->cell_post_process(nvmem->priv, id, index,
cell->offset, buf, cell->bytes);
@@ -1671,6 +1680,14 @@ static int __nvmem_cell_entry_write(stru
@@ -1670,6 +1679,14 @@ static int __nvmem_cell_entry_write(stru
(cell->bit_offset == 0 && len != cell->bytes))
return -EINVAL;

View File

@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -695,6 +695,7 @@ static int nvmem_validate_keepouts(struc
@@ -694,6 +694,7 @@ static int nvmem_validate_keepouts(struc
static int nvmem_add_cells_from_of(struct nvmem_device *nvmem)
{
@ -26,7 +26,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct device *dev = &nvmem->dev;
struct device_node *child;
const __be32 *addr;
@@ -724,6 +725,9 @@ static int nvmem_add_cells_from_of(struc
@@ -723,6 +724,9 @@ static int nvmem_add_cells_from_of(struc
info.np = of_node_get(child);

View File

@ -26,7 +26,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct gpio_desc *wp_gpio;
struct nvmem_layout *layout;
void *priv;
@@ -903,7 +902,6 @@ struct nvmem_device *nvmem_register(cons
@@ -902,7 +901,6 @@ struct nvmem_device *nvmem_register(cons
nvmem->type = config->type;
nvmem->reg_read = config->reg_read;
nvmem->reg_write = config->reg_write;
@ -34,7 +34,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
nvmem->keepout = config->keepout;
nvmem->nkeepout = config->nkeepout;
if (config->of_node)
@@ -1575,13 +1573,6 @@ static int __nvmem_cell_read(struct nvme
@@ -1574,13 +1572,6 @@ static int __nvmem_cell_read(struct nvme
if (rc)
return rc;
}

View File

@ -29,7 +29,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct device_node *np;
struct nvmem_device *nvmem;
struct list_head node;
@@ -471,6 +472,7 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -470,6 +471,7 @@ static int nvmem_cell_info_to_nvmem_cell
cell->bytes = info->bytes;
cell->name = info->name;
cell->read_post_process = info->read_post_process;
@ -37,7 +37,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cell->bit_offset = info->bit_offset;
cell->nbits = info->nbits;
@@ -1568,7 +1570,7 @@ static int __nvmem_cell_read(struct nvme
@@ -1567,7 +1569,7 @@ static int __nvmem_cell_read(struct nvme
nvmem_shift_read_buffer_in_place(cell, buf);
if (cell->read_post_process) {

View File

@ -51,7 +51,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int bytes;
int bit_offset;
int nbits;
@@ -469,6 +470,7 @@ static int nvmem_cell_info_to_nvmem_cell
@@ -468,6 +469,7 @@ static int nvmem_cell_info_to_nvmem_cell
{
cell->nvmem = nvmem;
cell->offset = info->offset;
@ -59,7 +59,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
cell->bytes = info->bytes;
cell->name = info->name;
cell->read_post_process = info->read_post_process;
@@ -1560,7 +1562,7 @@ static int __nvmem_cell_read(struct nvme
@@ -1559,7 +1561,7 @@ static int __nvmem_cell_read(struct nvme
{
int rc;
@ -68,7 +68,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rc)
return rc;
@@ -1571,7 +1573,7 @@ static int __nvmem_cell_read(struct nvme
@@ -1570,7 +1572,7 @@ static int __nvmem_cell_read(struct nvme
if (cell->read_post_process) {
rc = cell->read_post_process(cell->priv, id, index,
@ -77,7 +77,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rc)
return rc;
}
@@ -1594,14 +1596,15 @@ static int __nvmem_cell_read(struct nvme
@@ -1593,14 +1595,15 @@ static int __nvmem_cell_read(struct nvme
*/
void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len)
{

View File

@ -27,7 +27,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -696,7 +696,7 @@ static int nvmem_validate_keepouts(struc
@@ -695,7 +695,7 @@ static int nvmem_validate_keepouts(struc
return 0;
}
@ -36,7 +36,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
{
struct nvmem_layout *layout = nvmem->layout;
struct device *dev = &nvmem->dev;
@@ -704,7 +704,7 @@ static int nvmem_add_cells_from_of(struc
@@ -703,7 +703,7 @@ static int nvmem_add_cells_from_of(struc
const __be32 *addr;
int len, ret;
@ -45,7 +45,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
struct nvmem_cell_info info = {0};
addr = of_get_property(child, "reg", &len);
@@ -742,6 +742,28 @@ static int nvmem_add_cells_from_of(struc
@@ -741,6 +741,28 @@ static int nvmem_add_cells_from_of(struc
return 0;
}
@ -74,7 +74,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
int __nvmem_layout_register(struct nvmem_layout *layout, struct module *owner)
{
layout->owner = owner;
@@ -972,7 +994,7 @@ struct nvmem_device *nvmem_register(cons
@@ -971,7 +993,7 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;
@ -83,7 +83,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
if (rval)
goto err_remove_cells;
@@ -982,6 +1004,10 @@ struct nvmem_device *nvmem_register(cons
@@ -981,6 +1003,10 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;

View File

@ -15,7 +15,7 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -998,17 +998,17 @@ struct nvmem_device *nvmem_register(cons
@@ -997,17 +997,17 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;

View File

@ -14,7 +14,7 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -786,10 +786,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste
@@ -785,10 +785,10 @@ EXPORT_SYMBOL_GPL(nvmem_layout_unregiste
static struct nvmem_layout *nvmem_layout_get(struct nvmem_device *nvmem)
{

View File

@ -14,7 +14,7 @@ Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -772,12 +772,16 @@ int __nvmem_layout_register(struct nvmem
@@ -771,12 +771,16 @@ int __nvmem_layout_register(struct nvmem
list_add(&layout->node, &nvmem_layouts);
spin_unlock(&nvmem_layout_lock);

View File

@ -95,7 +95,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
.stride = sizeof(u32),
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -998,9 +998,11 @@ struct nvmem_device *nvmem_register(cons
@@ -997,9 +997,11 @@ struct nvmem_device *nvmem_register(cons
if (rval)
goto err_remove_cells;
@ -132,7 +132,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
imx_ocotp_nvmem_config.priv = priv;
--- a/drivers/nvmem/meson-efuse.c
+++ b/drivers/nvmem/meson-efuse.c
@@ -74,6 +74,7 @@ static int meson_efuse_probe(struct plat
@@ -80,6 +80,7 @@ static int meson_efuse_probe(struct plat
econfig->dev = dev;
econfig->name = dev_name(dev);

View File

@ -48,7 +48,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
mtd->nvmem = nvmem_register(&config);
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -936,7 +936,7 @@ struct nvmem_device *nvmem_register(cons
@@ -935,7 +935,7 @@ struct nvmem_device *nvmem_register(cons
nvmem->nkeepout = config->nkeepout;
if (config->of_node)
nvmem->dev.of_node = config->of_node;

View File

@ -15,7 +15,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
#include "gpiolib.h"
#include "gpiolib-of.h"
@@ -1059,3 +1061,72 @@ void of_gpio_dev_init(struct gpio_chip *
@@ -1111,3 +1113,72 @@ void of_gpio_dev_init(struct gpio_chip *
else
gc->of_node = gdev->dev.of_node;
}

View File

@ -244,7 +244,7 @@ Signed-off-by: Alexandros C. Couloumbis <alex@ozo.com>
+}
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -374,14 +374,41 @@ static int __init init_jffs2_fs(void)
@@ -375,14 +375,41 @@ static int __init init_jffs2_fs(void)
BUILD_BUG_ON(sizeof(struct jffs2_raw_inode) != 68);
BUILD_BUG_ON(sizeof(struct jffs2_raw_summary) != 32);

View File

@ -18,7 +18,7 @@ Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
--- a/drivers/nvmem/core.c
+++ b/drivers/nvmem/core.c
@@ -798,6 +798,19 @@ static struct nvmem_layout *nvmem_layout
@@ -797,6 +797,19 @@ static struct nvmem_layout *nvmem_layout
return NULL;
/*

View File

@ -33,7 +33,7 @@ string.
#include <linux/init.h>
#include <linux/kref.h>
#include <linux/module.h>
@@ -696,6 +699,62 @@ static int nvmem_validate_keepouts(struc
@@ -695,6 +698,62 @@ static int nvmem_validate_keepouts(struc
return 0;
}
@ -96,7 +96,7 @@ string.
static int nvmem_add_cells_from_dt(struct nvmem_device *nvmem, struct device_node *np)
{
struct nvmem_layout *layout = nvmem->layout;
@@ -731,6 +790,25 @@ static int nvmem_add_cells_from_dt(struc
@@ -730,6 +789,25 @@ static int nvmem_add_cells_from_dt(struc
if (layout && layout->fixup_cell_info)
layout->fixup_cell_info(nvmem, layout, &info);

View File

@ -950,7 +950,7 @@ static const struct net_device_ops ipqess_axi_netdev_ops = {
.ndo_uninit = ipqess_uninit,
.ndo_open = ipqess_open,
.ndo_stop = ipqess_stop,
.ndo_do_ioctl = ipqess_do_ioctl,
.ndo_eth_ioctl = ipqess_do_ioctl,
.ndo_start_xmit = ipqess_xmit,
.ndo_get_stats = ipqess_get_stats,
.ndo_set_mac_address = ipqess_set_mac_address,

View File

@ -4,7 +4,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support
--- a/drivers/net/ppp/ppp_generic.c
+++ b/drivers/net/ppp/ppp_generic.c
@@ -2952,6 +2952,22 @@ char *ppp_dev_name(struct ppp_channel *c
@@ -2967,6 +2967,22 @@ char *ppp_dev_name(struct ppp_channel *c
return name;
}
@ -27,7 +27,7 @@ Subject: [PATCH] UGW_SW-29163: ATM oam support
/*
* Disconnect a channel from the generic layer.
@@ -3598,6 +3614,7 @@ EXPORT_SYMBOL(ppp_unregister_channel);
@@ -3613,6 +3629,7 @@ EXPORT_SYMBOL(ppp_unregister_channel);
EXPORT_SYMBOL(ppp_channel_index);
EXPORT_SYMBOL(ppp_unit_number);
EXPORT_SYMBOL(ppp_dev_name);

View File

@ -272,10 +272,10 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
free_irq(ch->dma.irq, priv);
- if (IS_RX(ch->idx)) {
+ if (ch == &priv->txch) {
int desc;
for (desc = 0; desc < LTQ_DESC_NUM; desc++)
dev_kfree_skb_any(ch->skb[ch->dma.desc]);
@@ -223,66 +300,135 @@ static void
struct ltq_dma_channel *dma = &ch->dma;
for (dma->desc = 0; dma->desc < LTQ_DESC_NUM; dma->desc++)
@@ -224,66 +301,135 @@ static void
ltq_etop_hw_exit(struct net_device *dev)
{
struct ltq_etop_priv *priv = netdev_priv(dev);
@ -446,7 +446,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
}
static void
@@ -301,6 +447,39 @@ static const struct ethtool_ops ltq_etop
@@ -302,6 +448,39 @@ static const struct ethtool_ops ltq_etop
};
static int
@ -486,7 +486,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
ltq_etop_mdio_wr(struct mii_bus *bus, int phy_addr, int phy_reg, u16 phy_data)
{
u32 val = MDIO_REQUEST |
@@ -308,9 +487,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in
@@ -309,9 +488,9 @@ ltq_etop_mdio_wr(struct mii_bus *bus, in
((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET) |
phy_data;
@ -498,7 +498,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
return 0;
}
@@ -321,12 +500,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in
@@ -322,12 +501,12 @@ ltq_etop_mdio_rd(struct mii_bus *bus, in
((phy_addr & MDIO_ADDR_MASK) << MDIO_ADDR_OFFSET) |
((phy_reg & MDIO_REG_MASK) << MDIO_REG_OFFSET);
@ -515,7 +515,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
return val;
}
@@ -342,7 +521,10 @@ ltq_etop_mdio_probe(struct net_device *d
@@ -343,7 +522,10 @@ ltq_etop_mdio_probe(struct net_device *d
struct ltq_etop_priv *priv = netdev_priv(dev);
struct phy_device *phydev;
@ -527,7 +527,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
if (!phydev) {
netdev_err(dev, "no PHY found\n");
@@ -350,14 +532,17 @@ ltq_etop_mdio_probe(struct net_device *d
@@ -351,14 +533,17 @@ ltq_etop_mdio_probe(struct net_device *d
}
phydev = phy_connect(dev, phydev_name(phydev),
@ -547,7 +547,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
phy_attached_info(phydev);
@@ -378,8 +563,13 @@ ltq_etop_mdio_init(struct net_device *de
@@ -379,8 +564,13 @@ ltq_etop_mdio_init(struct net_device *de
}
priv->mii_bus->priv = dev;
@ -563,7 +563,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
priv->mii_bus->name = "ltq_mii";
snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
priv->pdev->name, priv->pdev->id);
@@ -416,18 +606,21 @@ static int
@@ -417,18 +607,21 @@ static int
ltq_etop_open(struct net_device *dev)
{
struct ltq_etop_priv *priv = netdev_priv(dev);
@ -595,7 +595,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
netif_tx_start_all_queues(dev);
return 0;
}
@@ -436,18 +629,19 @@ static int
@@ -437,18 +630,19 @@ static int
ltq_etop_stop(struct net_device *dev)
{
struct ltq_etop_priv *priv = netdev_priv(dev);
@ -625,7 +625,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
return 0;
}
@@ -457,15 +651,16 @@ ltq_etop_tx(struct sk_buff *skb, struct
@@ -458,15 +652,16 @@ ltq_etop_tx(struct sk_buff *skb, struct
int queue = skb_get_queue_mapping(skb);
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue);
struct ltq_etop_priv *priv = netdev_priv(dev);
@ -646,7 +646,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
netdev_err(dev, "tx ring full\n");
netif_tx_stop_queue(txq);
return NETDEV_TX_BUSY;
@@ -473,7 +668,7 @@ ltq_etop_tx(struct sk_buff *skb, struct
@@ -474,7 +669,7 @@ ltq_etop_tx(struct sk_buff *skb, struct
/* dma needs to start on a 16 byte aligned address */
byte_offset = CPHYSADDR(skb->data) % 16;
@ -655,7 +655,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
netif_trans_update(dev);
@@ -483,11 +678,11 @@ ltq_etop_tx(struct sk_buff *skb, struct
@@ -484,11 +679,11 @@ ltq_etop_tx(struct sk_buff *skb, struct
wmb();
desc->ctl = LTQ_DMA_OWN | LTQ_DMA_SOP | LTQ_DMA_EOP |
LTQ_DMA_TX_OFFSET(byte_offset) | (len & LTQ_DMA_SIZE_MASK);
@ -670,7 +670,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
netif_tx_stop_queue(txq);
return NETDEV_TX_OK;
@@ -498,11 +693,14 @@ ltq_etop_change_mtu(struct net_device *d
@@ -499,11 +694,14 @@ ltq_etop_change_mtu(struct net_device *d
{
struct ltq_etop_priv *priv = netdev_priv(dev);
unsigned long flags;
@ -686,7 +686,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
spin_unlock_irqrestore(&priv->lock, flags);
return 0;
@@ -555,6 +753,9 @@ ltq_etop_init(struct net_device *dev)
@@ -556,6 +754,9 @@ ltq_etop_init(struct net_device *dev)
if (err)
goto err_hw;
ltq_etop_change_mtu(dev, 1500);
@ -696,7 +696,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
memcpy(&mac, &priv->pldata->mac, sizeof(struct sockaddr));
if (!is_valid_ether_addr(mac.sa_data)) {
@@ -572,9 +773,10 @@ ltq_etop_init(struct net_device *dev)
@@ -573,9 +774,10 @@ ltq_etop_init(struct net_device *dev)
dev->addr_assign_type = NET_ADDR_RANDOM;
ltq_etop_set_multicast_list(dev);
@ -710,7 +710,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
return 0;
err_netdev:
@@ -594,6 +796,9 @@ ltq_etop_tx_timeout(struct net_device *d
@@ -595,6 +797,9 @@ ltq_etop_tx_timeout(struct net_device *d
err = ltq_etop_hw_init(dev);
if (err)
goto err_hw;
@ -720,7 +720,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
netif_trans_update(dev);
netif_wake_queue(dev);
return;
@@ -617,14 +822,18 @@ static const struct net_device_ops ltq_e
@@ -618,14 +823,18 @@ static const struct net_device_ops ltq_e
.ndo_tx_timeout = ltq_etop_tx_timeout,
};
@ -743,7 +743,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!res) {
@@ -650,31 +859,62 @@ ltq_etop_probe(struct platform_device *p
@@ -651,31 +860,62 @@ ltq_etop_probe(struct platform_device *p
goto err_out;
}
@ -821,7 +821,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
err = register_netdev(dev);
if (err)
@@ -703,31 +943,22 @@ ltq_etop_remove(struct platform_device *
@@ -704,31 +944,22 @@ ltq_etop_remove(struct platform_device *
return 0;
}

View File

@ -203,7 +203,7 @@ Signed-off-by: John Crispin <blogic@openwrt.org>
+early_param("ethaddr", setup_ethaddr);
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -757,7 +757,11 @@ ltq_etop_init(struct net_device *dev)
@@ -758,7 +758,11 @@ ltq_etop_init(struct net_device *dev)
if (err)
goto err_hw;

View File

@ -18,7 +18,7 @@ Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
#include <asm/checksum.h>
@@ -553,7 +554,8 @@ static int
@@ -554,7 +555,8 @@ static int
ltq_etop_mdio_init(struct net_device *dev)
{
struct ltq_etop_priv *priv = netdev_priv(dev);
@ -28,7 +28,7 @@ Signed-off-by: Johann Neuhauser <johann@it-neuhauser.de>
priv->mii_bus = mdiobus_alloc();
if (!priv->mii_bus) {
@@ -573,7 +575,15 @@ ltq_etop_mdio_init(struct net_device *de
@@ -574,7 +576,15 @@ ltq_etop_mdio_init(struct net_device *de
priv->mii_bus->name = "ltq_mii";
snprintf(priv->mii_bus->id, MII_BUS_ID_SIZE, "%s-%x",
priv->pdev->name, priv->pdev->id);

View File

@ -34,7 +34,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
int tx_irq;
int rx_irq;
@@ -399,7 +402,7 @@ ltq_etop_dma_init(struct net_device *dev
@@ -400,7 +403,7 @@ ltq_etop_dma_init(struct net_device *dev
int rx = priv->rx_irq - LTQ_DMA_ETOP;
int err;
@ -43,7 +43,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
priv->txch.dma.nr = tx;
priv->txch.dma.dev = &priv->pdev->dev;
@@ -676,8 +679,8 @@ ltq_etop_tx(struct sk_buff *skb, struct
@@ -677,8 +680,8 @@ ltq_etop_tx(struct sk_buff *skb, struct
return NETDEV_TX_BUSY;
}
@ -54,7 +54,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
priv->txch.skb[priv->txch.dma.desc] = skb;
netif_trans_update(dev);
@@ -925,6 +928,18 @@ static int ltq_etop_probe(struct platfor
@@ -926,6 +929,18 @@ static int ltq_etop_probe(struct platfor
spin_lock_init(&priv->lock);
SET_NETDEV_DEV(dev, &pdev->dev);

View File

@ -15,7 +15,7 @@ Signed-off-by: David S. Miller <davem@davemloft.net>
--- a/drivers/net/ethernet/lantiq_etop.c
+++ b/drivers/net/ethernet/lantiq_etop.c
@@ -402,7 +402,7 @@ ltq_etop_dma_init(struct net_device *dev
@@ -403,7 +403,7 @@ ltq_etop_dma_init(struct net_device *dev
int rx = priv->rx_irq - LTQ_DMA_ETOP;
int err;

View File

@ -436,7 +436,7 @@ Signed-off-by: Wolfram Sang <wsa@kernel.org>
pm_runtime_use_autosuspend(qup->dev);
--- a/drivers/i2c/busses/i2c-rcar.c
+++ b/drivers/i2c/busses/i2c-rcar.c
@@ -1059,7 +1059,7 @@ static int rcar_i2c_probe(struct platfor
@@ -1068,7 +1068,7 @@ static int rcar_i2c_probe(struct platfor
adap->bus_recovery_info = &rcar_i2c_bri;
adap->quirks = &rcar_i2c_quirks;
i2c_set_adapdata(adap, priv);

View File

@ -1501,7 +1501,7 @@ static const struct net_device_ops fe_netdev_ops = {
.ndo_start_xmit = fe_start_xmit,
.ndo_set_mac_address = fe_set_mac_address,
.ndo_validate_addr = eth_validate_addr,
.ndo_do_ioctl = fe_do_ioctl,
.ndo_eth_ioctl = fe_do_ioctl,
.ndo_change_mtu = fe_change_mtu,
.ndo_tx_timeout = fe_tx_timeout,
.ndo_get_stats64 = fe_get_stats64,