mbox series

[0/4] Updates for rfkill

Message ID 20210116125146.31932-1-markus.theil@tu-ilmenau.de (mailing list archive)
Headers show
Series Updates for rfkill | expand

Message

Markus Theil Jan. 16, 2021, 12:51 p.m. UTC
- Include older patch which updates rfkill.py to use Python 3 as
  the Python patch is based on this change.
- Update rfkill.h to include hard block reasons.
- Include support for hard block reasons to rfkill userspace.

Markus Theil (4):
  rfkill.py: migrate to python3
  rfkill: update rfkill.h
  rfkill: support hard block reason in python code
  rfkill: support hard block reason in C code

 rfkill.c  | 19 +++++++++++---
 rfkill.h  | 18 ++++++++++++-
 rfkill.py | 78 ++++++++++++++++++++++++++++++++++++++-----------------
 3 files changed, 86 insertions(+), 29 deletions(-)

Comments

Johannes Berg Jan. 21, 2021, 12:24 p.m. UTC | #1
Hi Markus,

Thanks for the patches!

I separately committed a fix for the buffering=0 issue, just so it's
separate and not part of the other changes.

>   rfkill.py: migrate to python3

Applied, but I made some cleanups.

>   rfkill: update rfkill.h
>   rfkill: support hard block reason in python code
>   rfkill: support hard block reason in C code

This is broken, unfortunately. Updating rfkill.h as is causes issues
because we read more data than we are willing to accept, which you've
fixed up in the support for hard block reasons patch. Seems that should
partially be in the original patch - e.g. checking "size >= V1" instead
of "size == V1".

Additionally, the hard block reasons in C patch is wrong because if the
read was short, the field is not initialized. Need to clear the event to
zeroes before reading it, or at least at the beginnning (I guess we can
assume the kernel will not change size between two reads).

The python patch I applied with some fixups.

johannes