drivers/s390/net/ctcm_mpc.c

Source file repositories/reference/linux-study-clean/drivers/s390/net/ctcm_mpc.c

File Facts

System
Linux kernel
Corpus path
drivers/s390/net/ctcm_mpc.c
Extension
.c
Size
58712 bytes
Lines
2128
Domain
Driver Families
Bucket
drivers/s390
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

if (sw == 0) {
			scnprintf(addr, sizeof(addr), "%16.16llx", (__u64)rptr);

			scnprintf(boff, sizeof(boff), "%4.4X", (__u32)ct);
			bhex[0] = '\0';
			basc[0] = '\0';
		}
		if ((sw == 4) || (sw == 12))
			strcat(bhex, " ");
		if (sw == 8)
			strcat(bhex, "	");

		scnprintf(tbuf, sizeof(tbuf), "%2.2llX", (__u64)*ptr);

		tbuf[2] = '\0';
		strcat(bhex, tbuf);
		if ((0 != isprint(*ptr)) && (*ptr >= 0x20))
			basc[sw] = *ptr;
		else
			basc[sw] = '.';

		basc[sw+1] = '\0';
		sw++;
		rm--;
		if (sw != 16)
			continue;
		if ((strcmp(duphex, bhex)) != 0) {
			if (dup != 0) {
				scnprintf(tdup, sizeof(tdup),
					  "Duplicate as above to %s", addr);
				ctcm_pr_debug("		       --- %s ---\n",
						tdup);
			}
			ctcm_pr_debug("   %s (+%s) : %s  [%s]\n",
					addr, boff, bhex, basc);
			dup = 0;
			strscpy(duphex, bhex);
		} else
			dup++;

		sw = 0;
		rm = 16;
	}  /* endfor */

	if (sw != 0) {
		for ( ; rm > 0; rm--, sw++) {
			if ((sw == 4) || (sw == 12))
				strcat(bhex, " ");
			if (sw == 8)
				strcat(bhex, "	");
			strcat(bhex, "	");
			strcat(basc, " ");
		}
		if (dup != 0) {
			scnprintf(tdup, sizeof(tdup),
				  "Duplicate as above to %s", addr);
			ctcm_pr_debug("		       --- %s ---\n", tdup);
		}
		ctcm_pr_debug("   %s (+%s) : %s  [%s]\n",
					addr, boff, bhex, basc);
	} else {
		if (dup >= 1) {
			scnprintf(tdup, sizeof(tdup),
				  "Duplicate as above to %s", addr);
			ctcm_pr_debug("		       --- %s ---\n", tdup);
		}
		if (dup != 0) {
			ctcm_pr_debug("   %s (+%s) : %s  [%s]\n",
				addr, boff, bhex, basc);
		}
	}

	return;

}   /*	 end of ctcmpc_dumpit  */
#endif

#ifdef DEBUGDATA
/*
 * Dump header and first 16 bytes of an sk_buff for debugging purposes.
 *
 * skb		The sk_buff to dump.
 * offset	Offset relative to skb-data, where to start the dump.
 */
void ctcmpc_dump_skb(struct sk_buff *skb, int offset)
{
	__u8 *p = skb->data;
	struct th_header *header;
	struct pdu *pheader;
	int bl = skb->len;

Annotation

Implementation Notes