dc68054305
- Restore 29 recipe symlinks (libdrm, qtbase, dbus, sddm, pipewire, etc.) - Restore 33 patches (KDE, libdrm, mesa, pipewire, sddm, wireplumber) - Restore 20+ local/scripts (audit, lint, test, build helpers) - Restore src/cook/scheduler.rs, status.rs, gnu-config/ - Restore scripts/patch-inclusion-gate.sh, run_mini1.sh, validate-collision-log.sh - Recover TLC source from HEAD (was overwritten by 0.2.3 checkout) - Recover 11 local/docs plans from HEAD (were overwritten) - Recover qt6-wayland-smoke symlink from HEAD - Fix MOTD: remove garbled ASCII art, use clean text - Update version: 0.2.0 -> 0.2.4 in os-release, motd, config - Reduce filesystem_size: 1536 -> 512 MiB - Add ABSOLUTE RULE to AGENTS.md: never delete/ignore packages - Reduce pcid scheme log verbosity: info -> debug
86 lines
2.2 KiB
C
86 lines
2.2 KiB
C
#ifndef __LINKMODE_H
|
|
#define __LINKMODE_H
|
|
|
|
#include <linux/bitmap.h>
|
|
#include <linux/ethtool.h>
|
|
#include <uapi/linux/ethtool.h>
|
|
|
|
static inline void linkmode_zero(unsigned long *dst)
|
|
{
|
|
bitmap_zero(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline void linkmode_fill(unsigned long *dst)
|
|
{
|
|
bitmap_fill(dst, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline void linkmode_copy(unsigned long *dst, const unsigned long *src)
|
|
{
|
|
bitmap_copy(dst, src, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline void linkmode_and(unsigned long *dst, const unsigned long *a,
|
|
const unsigned long *b)
|
|
{
|
|
bitmap_and(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline void linkmode_or(unsigned long *dst, const unsigned long *a,
|
|
const unsigned long *b)
|
|
{
|
|
bitmap_or(dst, a, b, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline bool linkmode_empty(const unsigned long *src)
|
|
{
|
|
return bitmap_empty(src, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline bool linkmode_andnot(unsigned long *dst,
|
|
const unsigned long *src1,
|
|
const unsigned long *src2)
|
|
{
|
|
return bitmap_andnot(dst, src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
#define linkmode_test_bit test_bit
|
|
#define linkmode_set_bit __set_bit
|
|
#define linkmode_clear_bit __clear_bit
|
|
#define linkmode_mod_bit __assign_bit
|
|
|
|
static inline void linkmode_set_bit_array(const int *array, int array_size,
|
|
unsigned long *addr)
|
|
{
|
|
int i;
|
|
|
|
for (i = 0; i < array_size; i++)
|
|
linkmode_set_bit(array[i], addr);
|
|
}
|
|
|
|
static inline int linkmode_equal(const unsigned long *src1,
|
|
const unsigned long *src2)
|
|
{
|
|
return bitmap_equal(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline int linkmode_intersects(const unsigned long *src1,
|
|
const unsigned long *src2)
|
|
{
|
|
return bitmap_intersects(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
static inline int linkmode_subset(const unsigned long *src1,
|
|
const unsigned long *src2)
|
|
{
|
|
return bitmap_subset(src1, src2, __ETHTOOL_LINK_MODE_MASK_NBITS);
|
|
}
|
|
|
|
void linkmode_resolve_pause(const unsigned long *local_adv,
|
|
const unsigned long *partner_adv,
|
|
bool *tx_pause, bool *rx_pause);
|
|
|
|
void linkmode_set_pause(unsigned long *advertisement, bool tx, bool rx);
|
|
|
|
#endif /* __LINKMODE_H */
|