#include <linux/skbuff.h>
#include <linux/switch.h>
#include <linux/of.h>
-#include <linux/version.h>
#include <uapi/linux/mii.h>
#define SWCONFIG_DEVNAME "switch%d"
.module = THIS_MODULE,
.ops = swconfig_ops,
.n_ops = ARRAY_SIZE(swconfig_ops),
-#if LINUX_VERSION_CODE > KERNEL_VERSION(6,0,0)
.resv_start_op = SWITCH_CMD_SET_VLAN + 1,
-#endif
};
#ifdef CONFIG_OF
sw_trig = (void *) trigger;
port_mask = 0;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
spin_lock(&trigger->leddev_list_lock);
-#else
- read_lock(&trigger->leddev_list_lock);
-#endif
list_for_each(entry, &trigger->led_cdevs) {
struct led_classdev *led_cdev;
struct swconfig_trig_data *trig_data;
read_unlock(&trig_data->lock);
}
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
spin_unlock(&trigger->leddev_list_lock);
-#else
- read_unlock(&trigger->leddev_list_lock);
-#endif
sw_trig->port_mask = port_mask;
struct led_trigger *trigger;
trigger = &sw_trig->trig;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
spin_lock(&trigger->leddev_list_lock);
-#else
- read_lock(&trigger->leddev_list_lock);
-#endif
list_for_each(entry, &trigger->led_cdevs) {
struct led_classdev *led_cdev;
led_cdev = list_entry(entry, struct led_classdev, trig_list);
swconfig_trig_led_event(sw_trig, led_cdev);
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,16,0)
spin_unlock(&trigger->leddev_list_lock);
-#else
- read_unlock(&trigger->leddev_list_lock);
-#endif
}
static void