CSA channel switch call directly interacts with VDEV
state machine, move CSA restart to go through serialization
service.
CRs-Fixed: 2598123
Change-Id: Ic0bea64b56f54eed354e11d0873ae4423e365cca
Before iterating in pending list, use spinlock to avoid possible
race condition.
Remove function wlan_serialization_get_active_list_next_node_using_psoc
as it not being used and is part of legacy flow which is suppose to be
removed eventually.
Change-Id: I9e7cbd9db8b5a1c45915bf5291cd5011c276d0e2
CRs-Fixed: 2573425
When moving a blocking command from pending to active queue,
we release the lock and call the activation cb.
After the activation cb returns, we update the blocking cmd
waiting flag based on the active cmd node's "is_blocking" param.
If the activation cb is also resulting in removing the command,
then after the cb returns, the active cmd node is returned to the
free pool and our check fails, and we miss to update the blocking
cmd waiting flag, resulting in no further commands moving to the
active queue.
The update to the blocking command should be done atomically,
immediately after it moves to active queue and before releasing
the lock for the activation callback.
Change-Id: Idedccb16ce68bb2166fb3970cd231fe738ec6af2
CRs-Fixed: 2554767
MCL presently sends the vdev delete to firmware via serialization,
with a new requirement vdev delete cannot be sent via serialization.
So, disable the serialization for the vdev before sending the vdev
delete to firmware.
Change-Id: Ieffccaf815eff7627d39b0191a7be121e85965fd
CRs-Fixed: 2566113
In case vdev is logically deleted the serialization active timer fails
to start because it fails to get vdev ref count. Now in this case the
cmd is not removed from the active queue and is just marked
CMD_ACTIVE_MARKED_FOR_REMOVAL because CMD_MARKED_FOR_ACTIVATION is set.
Even during pdev stop as CMD_MARKED_FOR_ACTIVATION is set the command is
not removed.
Fix is to reset CMD_MARKED_FOR_ACTIVATION flag and handle it in same way
as the activate failure case.
Also reset the timer cmd after timer start failure to avoid vdev ref count
release by WLAN_SERIALIZATION_ID even when it failed to take the ref count
in first place.
Change-Id: Ic078efa8ce4ad563087381b8c95eba91894d8a48
CRs-Fixed: 2535245
Log level of some expected prints were set to error level because
of which the prints were coming frequently.
Moving log level of these expected prints from error to debug level.
Change-Id: Ifd2672cd73db02488ce3055ca5e35d423d4f4761
CRs-Fixed: 2522164
The serialization vdev destroy handlers extracts the psoc
from the vdev, and get its psoc component object.
If the pdev or psoc is NULL for some reason, we get a
crash in object manager while trying to retrieve the serialization
psoc object.
So check for valid pdev/psoc before we get the serialization psoc object.
Change-Id: I9ca45654250403a8b5fe674431251defd1aac6e8
CRs-Fixed: 2524231
As a part of vdev manager conversion, vdev delete code is
refactored. Legacy code and naming is removed. In vdev manager
operations, STA_SESSION is addressed as VDEV.
Hence WLAN_SER_CMD_DEL_STA_SESSION macro is renamed to
WLAN_SER_CMD_VDEV_DELETE.
Change-Id: I08bf6b2e69f5635d5ebc2548c18991bbb12b3985
CRs-Fixed: 2508147
The host driver serialization module currently supports upto 4
commands in non scan pending queue. This is calculated at the
wlan_serialization_vdev_create_handler() as:
max_pending_cmds = (WLAN_SER_MAX_PENDING_CMDS /
WLAN_SER_MAX_VDEVS)
But in SAP case, if multiple STA sends deauth at the same time,
4 pending commands in non scan pending queue is not sufficient
and will result in only disassoc from the first 4 STA getting
honored.
The current host wlan driver supports 3 SAP mode and
2 STA vdevs amounting to a total of 5 vdevs supported.
So calculate the total non scan pending commands for
serialization based on the total peers supported for each
mode to fix this issue.
In SAP case, maximum 32 peer are supported and for STA case,
maximum 4 pending commands for serialization. So change the
max pending commands calculation as:
max_pending_cmds = (No. of sap modes supported * 32) +
(No .of STA modes supported *4 )
For MCL case the definition of WLAN_SER_MAX_PENDING_CMDS
will be moved to Kbuild.
For WIN case, the existing maximum count will be retained.
Change-Id: Iff1d9430b45e26812b600560b08e85e6040eafef
CRs-Fixed: 2483520
Add API to support cancellation of a non-scan command to match with the
vdev and is a non-blocking serialization command.
Change-Id: I31556ea8f35b9caf314f10eba0f0f655e3fce806
CRs-Fixed: 2481935
Add change to update the doc section for the list of commands supported
by the serialization module.
Change-Id: I3534d3798291fa259c8ee4de38df8c0e8649e5ab
CRs-Fixed: 2477833
Add API to fetch the vdev queue status and avoid enqueueing command
to serialization queue if the vdev queue is found to be disabled
Change-Id: If615b07dceaeb3113592f24355f254c8e70ca8a2
CRs-Fixed: 2470208
Add change to release vdev reference only on successful removal
of active cmd from serialization active queue.
Change-Id: I2e14f7f53dc38388cdd05f029edc9329f9dd86a7
CRs-Fixed: 2463724
Rmmod process:
wlan_hdd_pld_remove --> hdd_stop_adapter --> hdd_vdev_destroy
--> WLAN_SER_CMD_DEL_STA_SESSION (25) cmd queued --> PLD_FW_DOWN
(will complete wait event as part of qdf_complete_wait_events)
--> hdd_wlan_stop_modules --> cds_disable -->
dispatcher_psoc_disable --> wlan_serialization_psoc_disable -->
wlan_serialization_timer_destroy --> umac_stop --> csr_stop -->
wlan_ser_cancel_non_scan_cmd -> check if timer is present but th
timer are already destroyed, so assert.
Move wlan_serialization_purge_cmd_list into converged API file to
be shared by MCC and WIN.
Change-Id: Iad557e4a05d682c257be0c39049c52950e5eb530
CRs-Fixed: 2451058
The serialization active command removal can happen in two ways
1. Its through wlan_serialization_remove_cmd API
2. Command times out and command timeout handler is called.
In case, cmd times out and handler is called in scheduler
context and as part of the active cmd removal,
the active cmd is removed, and release cmd cb is called
which could delete the vdev(post last reference release).
Then as part of moving cmd from pending to active,
the vdev queues are null, and we see a panic.
We take a vdev reference, when timer for active cmd is started.
For active cmd removal through wlan_serialization_remove_cmd,
we release the reference when the timer is stopped.
To avoid vdev destroy, in case command times out,
and until the command timeout handling is completed,
we hold vdev reference from when timer is started,
until timer handler completes.
Change-Id: I16b6864f75e8bf354da6f8b16c3aaa6cf39d7ac7
CRs-Fixed: 2422422
In the current implementation, we print the ser history
from index 0 to the current index of the ciruclar buffer,
so when buffer overflows we print only few recent items.
Instead, we should print all the elements in the circular buffer
starting from current index to entire length of the circular buffer.
This will print all the elements in the circular buffer
when it overflows and also takes care of printing
required items when buffer is not overflown.
Change-Id: I6c54cb34de7a1ba24ee0204004cc9a203173c66b
CRs-Fixed: 2430483
Since umac cmd is specific to the module adding cmd to serialization
queue, an API is needed to validate the umac_cmd associated with that
serialization context holding the serialization queue lock.
Change-Id: Iadb4deb17ffabd780432a29e7cbd37024fd431fe
CRs-Fixed: 2430764
There is an assert inside the serialization timer cb.
This timer cb can also be called in the scheduler context.
So if we get a scan cancel request, it is posted to scheduler
and after that command timesout, the timer cb is posted
to the scheduler.
So first the cancel is executed and the command is removed.
After that, the timer handler is executed which will find timer->cmd
to NULL.
So, by the time, the timer handler is involved in scheduler context
the command might be cancelled so we return an error when cmd is null
in timer handler cb.
Change-Id: I03651a63de88fe5c6467c5783254ffd006c663d2
CRs-Fixed: 2427323
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within umac serialization replace any such comparisons
with logical operations performed on the pointer itself.
Change-Id: I6b8ff46dacfd2f9a883262f6336f35f5aff499bc
CRs-Fixed: 2420150
When a serialization cmd is activated and activation is process in
scheduler context, it is observed that the timeout for that cmd
occurs and the cmd is released even though the activation in
scheduler context is still in progress.
This will lead to accessing the serialization cmd after free,
leading to memory corruption error.
Add change to avoid this by posting timeout message to scheduler
thread which will help synchronize the cmd execution in scheduler.
Change-Id: Ib2234331844f48d0d219f430f5b585f792282d42
CRs-Fixed: 2419854
Add change to fetch the activation status for the command in the
active queue of a given vdev.
Change-Id: I2ef87b5423f3749eb68e50147c9a30115492197c
CRs-Fixed: 2415236
Add modules and API's to issue command WMI_NDP_CMDID. This
command, for now, can request Firmware to terminate all NDP's
associated with the given vdev. Add module that extracts
event information from event WMI_NDP_EVENTID. This event acts
as a response to command WMI_NDP_CMDID, and carries NDP
related status information for the host. Extract mac_id from
the updated TLV of NDP confirm and schedule update events.
Add modules and API's to support new NDP command and event.
Change-Id: Ibf6312cb3669b5e62ada3f4ad852be87f14ae09f
CRs-Fixed: 2384535
Fix the type for nan_serialized_cb and remove unnecessary
type casts from other callbacks.
Change-Id: Ie4e45f5a7e9fc17eb1c45fa18160e3bbd47151fe
CRs-Fixed: 2402989
The vdevid used in the wlan_ser_print_history function
is not initialized by default
and we pass them to subsequent function without initializing
though that would not be used.
Initialize the vdev id by default irrespective of its use.
Change-Id: I0c45528bdfcb8c6e37a40ea9a68f5c56c1cda753
CRs-Fixed: 2407068
In wlan_ser_cancel_non_scan_cmd, cmd.vdev pointer is used to get vdev id
after WLAN_SER_CB_RELEASE_MEM_CMD is called. In WLAN_SER_CB_RELEASE_MEM_CMD
the command release the vdev ref count and it may lead to physical
deletion of vdev. Thus getting vdev id from vdev may result in invalid
vdev_id and thus proper bits are not reset in vdev_active_cmd_bitmap
for the vdev.
Thus no new blocking command will be allowed in serialization active queue.
Fix is to get proper vdev_id before WLAN_SER_CB_RELEASE_MEM_CMD is called
and use that to reset the pdev_q->vdev_active_cmd_bitmap bit for vdev_id
Change-Id: I2756f1632a72f086e9d214a437ad794ae08afc45
CRs-Fixed: 2395851
Currently many modules use the scheduler_post_msg API which
doesn't allow the driver to know about the src, and destination
modules.
Fix is to call scheduler_post_message which has src, dest, and
the que id.
Change-Id: I6cba6b2f8febb0cb0165af48704de91a893a8b49
CRs-Fixed: 2385912
In psoc open, driver try to get the number of PDEV and
allocate memory for number of timers. But during psoc open number of
pdev are 0, thus timers are not allocated for non scan active queues.
Now if all scan active queues are full and a non scan command is
activated, it tries to find empty timer, which is not found, as
all timers are used by scan commands. Thus timer is not started for
this command and when this command is aborted the timer destroy API
return failure and thus the command is not removed from the active
queue.
Allocate the timer during psoc enable where pdevs are already created
and driver can get the number of pdev and print error if start timer
fails for a command.
Change-Id: Ia5b22e2849c58992a7d3d4097becc257ac673157
CRs-Fixed: 2389157
The current serialization history output is printed with
file and line information since the common ser_err is using
the FL variants of trace function.
Add ser_err_no_fl to use non FL variant of the trace function
for printing the serialization history.
Change-Id: Icc0b5d00d50aaa8fd8fb6b072784a26177004219
CRs-Fixed: 2387039
Change default log level of serialization to QDF_TRACE_LEVEL_ERROR
Change error print to debug, when pending queue is empty,
which is a possible expected case.
Change-Id: I21cd6b5f158d5dffbc6e7309c9202e7e2e0162e8
CRs-Fixed: 2387017
There is an instance where the cmd_in_use flag is not
reset when cmd_list is not returned to the free pool
Need to reset the cmd_in_use every time the cmd_list is
returned to the free pool
Change-Id: I1fae24dc691779c6c372936d2963f11f98898750
CRs-Fixed: 2379448
Add mlme message queue handler as the call back for non scan commands
getting activated in the scheduler context.
Add cmd already exists enum to be returned if the command already exists
in the serialization queue.
Change-Id: I24fe453ffddbd4341459874458f11688adebc740
CRs-Fixed: 2377219
If two threads T1 and T2 are trying to stop the serialization timer,
both can get the timer while holding lock. Timer cmd pointer is set
to NULL after releasing lock.
Now if a third thread T3 is trying to start the timer at same time,
it may get the timer as soon as T1 make cmd NULL and adds its cmd
pointer to the timer in the list.
But T2, which was also trying to stop the timer can stop the timer
and set cmd back to NULL again. Thus T3 will not have the timer in
the timer list.
Now when driver try to abort/flush the command it will not find the
timer and In case timer is not found the command is not freed, leading
to vdev ref leak.
To fix this stop and update the timer while holding lock.
Change-Id: I363a4d36181328be310c7c980c981302501a9453
CRs-Fixed: 2376733
Each cmd in serialization list holds a vdev ref by
I8d573ff5a25e6dff928b2708e51ad7b97e292277. When vdev is
destroyed physically, it means vdev ref count is 0, all
serialization cmds of this vdev are released, don't need purge
in vdev destroy handler.
Change-Id: Iea75707c88154e1e3e87369285b82d1288523e22
CRs-Fixed: 2367242
When the command is released from the queue, it is added back to the global
pool. Reset the status flag of the command before releasing it back to the
global pool.
Change-Id: I3e51fc6aa0ffc0dafe87b838a5a256fc65d12d09
CRs-Fixed: 2372562
In the current implementation, if there are any active commands
in the vdev queues then on vdev destroy we remove the commands from
the respective queue and return the command to the global pool.
We should also stop the timers for the corresponding active commands,
otherwise the timeout cb may be called after the destroy is executed.
Change-Id: I51a1049e952073d83b5caee3835e4f9adca2bb9e
CRs-Fixed: 2365411
There were minor review comments for the change
for adding activation reason also to activation sb
which was not addressed in the changeset
since it had all the necessaary approvals and it
was in path for merge.
Addressed all the comments as part of this change.
Change-Id: I8035adf2dce152e60eef1494aa7f100c2d567f41
CRs-Fixed: 2361327
Add field for activation reason to serialization cmd structure
Also modified the other boolean fields to a bit field for optimization
The new field added to serialization command structure will be used
to update the activation reason about how the command was activated,
either directly from active queue or as part of movement of
pending to active queue.
Change-Id: I8a1da79b7ef60e8d8a739ae2f265418418e2c859
CRs-Fixed: 2361327
Add a new API to update serialization timer value for a
give command in the active queue.
Change-Id: I725a35822e881facd9e2f4a51e41ea5ee8d6bbd8
CRs-Fixed: 2352317
Add API to peek into the vdev active queue
and return the command type present in the
active queue of a given vdev
Change-Id: I4a4dc419f4a51645cc7e611ffb7053a8c8240381
CRs-Fixed: 2354133