qcacld-3.0: Add uevent to update status & data

Update uevent status to hdd, based on the uevent received
from the platform driver

Change-Id: I1ac0fa61efa8b7f4f9d5e4e6abfcf969dbc1c592
CRs-fixed: 2027958
This commit is contained in:
Anurag Chouhan
2017-04-13 13:57:09 +05:30
committed by snandini
부모 bd92f53484
커밋 1ddb9b3e47
4개의 변경된 파일61개의 추가작업 그리고 30개의 파일을 삭제

파일 보기

@@ -129,7 +129,30 @@ enum pld_driver_status {
PLD_UNINITIALIZED,
PLD_INITIALIZED,
PLD_LOAD_UNLOAD,
};
/**
* enum pld_uevent - WLAN FW status
* @PLD_RECOVERY: driver is recovering
* @PLD_FW_DOWN: FW is down
*/
enum pld_uevent {
PLD_RECOVERY,
PLD_FW_DOWN,
};
/**
* struct pld_uevent_data - uevent status received from platform driver
* @uevent: uevent type
* @fw_down: FW down info
*/
struct pld_uevent_data {
enum pld_uevent uevent;
union {
struct {
bool crashed;
} fw_down;
};
};
/**
@@ -282,7 +305,7 @@ enum pld_recovery_reason {
* is enabled
* @modem_status: optional operation, will be called when platform driver
* sending modem power status to WLAN FW
* @update_status: optional operation, will be called when platform driver
* @uevent: optional operation, will be called when platform driver
* updating driver status
* @runtime_suspend: optional operation, prepare the device for a condition
* in which it won't be able to communicate with the CPU(s)
@@ -316,7 +339,7 @@ struct pld_driver_ops {
void (*modem_status)(struct device *dev,
enum pld_bus_type bus_type,
int state);
void (*update_status)(struct device *dev, uint32_t status);
void (*uevent)(struct device *dev, struct pld_uevent_data *uevent);
int (*runtime_suspend)(struct device *dev,
enum pld_bus_type bus_type);
int (*runtime_resume)(struct device *dev,

파일 보기

@@ -181,22 +181,30 @@ static void pld_pcie_notify_handler(struct pci_dev *pdev, int state)
}
/**
* pld_pcie_update_status() - update wlan driver status callback function
* pld_pcie_uevent() - update wlan driver status callback function
* @pdev: PCIE device
* @status: driver status
* @status driver uevent status
*
* This function will be called when platform driver wants to update wlan
* driver's status.
*
* Return: void
*/
static void pld_pcie_update_status(struct pci_dev *pdev, uint32_t status)
static void pld_pcie_uevent(struct pci_dev *pdev, uint32_t status)
{
struct pld_context *pld_context;
struct pld_uevent_data data;
pld_context = pld_get_global_context();
if (pld_context->ops->update_status)
pld_context->ops->update_status(&pdev->dev, status);
if (!pld_context)
return;
data.uevent = status;
if (!pld_context->ops->uevent)
pld_context->ops->uevent(&pdev->dev, &data);
return;
}
#ifdef FEATURE_RUNTIME_PM
@@ -449,7 +457,7 @@ struct cnss_wlan_driver pld_pcie_ops = {
.shutdown = pld_pcie_shutdown,
.crash_shutdown = pld_pcie_crash_shutdown,
.modem_status = pld_pcie_notify_handler,
.update_status = pld_pcie_update_status,
.update_status = pld_pcie_uevent,
#ifdef CONFIG_PM
.suspend = pld_pcie_suspend,
.resume = pld_pcie_resume,

파일 보기

@@ -239,25 +239,35 @@ static int pld_snoc_uevent(struct device *dev,
struct icnss_uevent_data *uevent)
{
struct pld_context *pld_context;
uint32_t status;
struct icnss_uevent_fw_down_data *uevent_data = NULL;
struct pld_uevent_data data;
pld_context = pld_get_global_context();
if (!pld_context)
return -EINVAL;
if (!pld_context->ops->update_status)
if (!pld_context->ops->uevent)
goto out;
if (!uevent)
return -EINVAL;
switch (uevent->uevent) {
case ICNSS_UEVENT_FW_CRASHED:
status = PLD_RECOVERY;
data.uevent = PLD_RECOVERY;
break;
case ICNSS_UEVENT_FW_DOWN:
if (uevent->data == NULL)
return -EINVAL;
uevent_data = (struct icnss_uevent_fw_down_data *)uevent->data;
data.uevent = PLD_FW_DOWN;
data.fw_down.crashed = uevent_data->crashed;
break;
default:
goto out;
}
pld_context->ops->update_status(dev, status);
pld_context->ops->uevent(dev, &data);
out:
return 0;
}