Michal Kazior <[email protected]> writes:

> On 14/06/13 14:34, Kalle Valo wrote:
>> Michal Kazior <[email protected]> writes:
>>
>>> This can be useful for testing.
>>>
>>> Signed-off-by: Michal Kazior <[email protected]>
>>
>> This is handy.
>>
>>> +static ssize_t ath10k_read_simulate_fw_crash(struct file *file,
>>> +                                        char __user *user_buf,
>>> +                                        size_t count, loff_t *ppos)
>>> +{
>>> +   const char buf[] = "To simulate firmware crash write anything to this"
>>> +                      " file.\nThis will force firmware to report a crash"
>>> +                      " to the host system.\n";
>>> +   return simple_read_from_buffer(user_buf, count, ppos, buf, strlen(buf));
>>> +}
>>
>> But I'm not sure if just writing something to the file is a good idea.
>> Should it have some sort of protection, for example that user needs to
>> write a keyword or something?
>
> There are a few types of firmware failures that can be triggered. And
> there's also a delay that can be specified. So in theory we could
> accept parameters.
>
> I wanted to keep things simple though. I didn't need anything more
> fancy than this to test firmware crashes/recovery.

Sorry, I wasn't clear above. I was just worried that a user might
accidentally crash the firmware through this interface by writing to a
wrong file. Not very likely scenario, but can happen anyway. Having some
sort of extra check (like a keyword) would avoid that case.

-- 
Kalle Valo
_______________________________________________
ath9k-devel mailing list
[email protected]
https://lists.ath9k.org/mailman/listinfo/ath9k-devel

Reply via email to