• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/char/tpm/

Lines Matching defs:chip

70 static int wait_for_stat(struct tpm_chip *chip, u8 mask, u8 val, u8 * data)
75 *data = inb(chip->vendor.base + NSC_STATUS);
83 *data = inb(chip->vendor.base + 1);
92 static int nsc_wait_for_ready(struct tpm_chip *chip)
98 status = inb(chip->vendor.base + NSC_STATUS);
100 status = inb(chip->vendor.base + NSC_DATA);
108 status = inb(chip->vendor.base + NSC_STATUS);
110 status = inb(chip->vendor.base + NSC_DATA);
116 dev_info(chip->dev, "wait for ready failed\n");
121 static int tpm_nsc_recv(struct tpm_chip *chip, u8 * buf, size_t count)
131 if (wait_for_stat(chip, NSC_STATUS_F0, NSC_STATUS_F0, &data) < 0) {
132 dev_err(chip->dev, "F0 timeout\n");
136 inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_NORMAL) {
137 dev_err(chip->dev, "not in normal mode (0x%x)\n",
145 (chip, NSC_STATUS_OBF, NSC_STATUS_OBF, &data) < 0) {
146 dev_err(chip->dev,
152 *p = inb(chip->vendor.base + NSC_DATA);
156 (wait_for_stat(chip, NSC_STATUS_F0, NSC_STATUS_F0, &data) < 0)) {
157 dev_err(chip->dev, "F0 not set\n");
160 if ((data = inb(chip->vendor.base + NSC_DATA)) != NSC_COMMAND_EOC) {
161 dev_err(chip->dev,
175 static int tpm_nsc_send(struct tpm_chip *chip, u8 * buf, size_t count)
181 * If we hit the chip with back to back commands it locks up
186 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
188 if (nsc_wait_for_ready(chip) != 0)
191 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {
192 dev_err(chip->dev, "IBF timeout\n");
196 outb(NSC_COMMAND_NORMAL, chip->vendor.base + NSC_COMMAND);
197 if (wait_for_stat(chip, NSC_STATUS_IBR, NSC_STATUS_IBR, &data) < 0) {
198 dev_err(chip->dev, "IBR timeout\n");
203 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {
204 dev_err(chip->dev,
208 outb(buf[i], chip->vendor.base + NSC_DATA);
211 if (wait_for_stat(chip, NSC_STATUS_IBF, 0, &data) < 0) {
212 dev_err(chip->dev, "IBF timeout\n");
215 outb(NSC_COMMAND_EOC, chip->vendor.base + NSC_COMMAND);
220 static void tpm_nsc_cancel(struct tpm_chip *chip)
222 outb(NSC_COMMAND_CANCEL, chip->vendor.base + NSC_COMMAND);
225 static u8 tpm_nsc_status(struct tpm_chip *chip)
227 return inb(chip->vendor.base + NSC_STATUS);
270 struct tpm_chip *chip = dev_get_drvdata(dev);
271 if ( chip ) {
272 release_region(chip->vendor.base, 2);
273 tpm_remove_hardware(chip->dev);
301 struct tpm_chip *chip;
341 if (!(chip = tpm_register_hardware(&pdev->dev, &tpm_nsc))) {
379 chip->vendor.base = base;