ksz9477_acl_get_cont_entr(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– ksz9477_acl_get_cont_entr(9) πŸ’–

okay so bestie, welcome to the Kernel API Manual β€” this one's literally called ksz9477_acl_get_cont_entr, and it's giving "count my friends and make sure they're standing in a neat little row" energy. stay with me, it's actually so good.


✨ SYNOPSIS ✨

int ksz9477_acl_get_cont_entr (struct ksz_device *dev , int port , int
index );

like, she takes three things and returns an int. that's the whole vibe. slay.


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” pointer to the KSZ9477 device structure. the main character, honestly.
  • port β€” the port number. yes, that port.
  • index β€” index of the starting ACL entry. our starting point, our home base, our origin story 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so let's talk about the KSZ9477 switch's Access Control List (ACL) system, because this is where it gets juicy. so inside an ACL entry there's a thing called the RuleSet, right? and that RuleSet tells you which entries contain Matching rules linked to it. iykyk.

that RuleSet is represented by two registers, and you're gonna wanna remember these:

  • KSZ9477_ACL_PORT_ACCESS_E
  • KSZ9477_ACL_PORT_ACCESS_F

every single bit that's set in these registers corresponds to an entry that contains a Matching rule for this RuleSet. every bit. no cap. πŸ”₯

so for a single Matching rule linked up, only one bit is set. easy, cute, simple. but when an entry links multiple Matching rules β€” which forms what we call a 'complex rule' β€” then multiple bits are set in these registers. it's giving multitasking. it's giving main character with a whole entourage.

so what does this function actually do? it checks that, for complex rules, all the entries containing those linked Matching rules are contiguous in terms of their indices β€” like, they've gotta be sitting next to each other, no gaps, no strangers in between. then it calculates and returns the number of those contiguous entries. periodt. πŸ’…


🌸 RETURN 🌸

here's the vibe check on what you get back:

  • 0 β€” the entry is empty and can be safely overwritten. blank canvas, go off. ✨
  • 1 β€” the entry represents a simple rule. lowkey iconic.
  • The number of contiguous entries β€” if it's the root entry of a complex rule. she's the leader, she's the root, she's everything πŸ‘‘
  • -ENOTEMPTY β€” the entry is part of a complex rule but not the root entry. sorry bestie, you're not the main character here.
  • -EINVAL β€” validation failed. 😭 it's giving error, it's giving try again.

🌈 SEE ALSO 🌈

the kernel file lives right here:

./drivers/net/dsa/microchip/ksz9477_acl.c

and these are all the besties in the same friend group:


ok that's the whole page, go read the source and stan a contiguous rule block for me 🧚

and that's a wrap, bestie! this lil gem comes to you from ./drivers/net/dsa/microchip, dated October 2026 β€” mwah, enjoy, and remember: keep your entries contiguous πŸ’œπŸ’–

πŸ“¦ where this page comes from